Dashboard styles override

My chart tooltips of series colors are not same as those are coded in chart code (html file) like red,blue and yellow, but in dashboard thosey are all blue.
How to fix ?


chart code in template

<style>
    #chartdiv {
        width: 100%;
        height: 100%;
    }
</style>
<script src="https://cdn.amcharts.com/lib/4/core.js"></script>
<script src="https://cdn.amcharts.com/lib/4/charts.js"></script>
<script src="https://cdn.amcharts.com/lib/4/themes/animated.js"></script>
<div id="chartdiv"></div>
<script>
 am4core.ready(function() {
am4core.useTheme(am4themes_animated);
     var chart = am4core.create("chartdiv", am4charts.XYChart);
     chart.background.fill = '#F1C40F '
     chart.background.opacity =0.1
     chart.data =[{"aika":"18.06.2022 13:31","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:32","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:33","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:34","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:35","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:36","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:37","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:38","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:39","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:40","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:41","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:42","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:43","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:44","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:45","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:46","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:47","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:48","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:49","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:50","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:51","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:52","sisälämpö":5,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:53","sisälämpö":6.77,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:54","sisälämpö":8.49,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:55","sisälämpö":10.16,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:56","sisälämpö":11.78,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:57","sisälämpö":13.35,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:58","sisälämpö":14.86,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 13:59","sisälämpö":16.33,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:00","sisälämpö":17.74,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:01","sisälämpö":19.11,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:02","sisälämpö":20.44,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:03","sisälämpö":21.72,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:04","sisälämpö":22.97,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:05","sisälämpö":24.17,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:06","sisälämpö":25.33,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:07","sisälämpö":26.46,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:08","sisälämpö":27.54,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:09","sisälämpö":28.6,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:10","sisälämpö":29.62,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:11","sisälämpö":30.6,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:12","sisälämpö":31.56,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:13","sisälämpö":32.48,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:14","sisälämpö":33.37,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:15","sisälämpö":34.24,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:16","sisälämpö":35.07,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:17","sisälämpö":35.88,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:18","sisälämpö":36.66,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:19","sisälämpö":37.42,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:20","sisälämpö":38.15,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:21","sisälämpö":38.86,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:22","sisälämpö":39.55,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:23","sisälämpö":40.21,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:24","sisälämpö":40.86,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:25","sisälämpö":41.48,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:26","sisälämpö":42.08,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:27","sisälämpö":42.66,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:28","sisälämpö":43.22,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:29","sisälämpö":43.77,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:30","sisälämpö":44.29,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:31","sisälämpö":44.8,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:32","sisälämpö":45.3,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:33","sisälämpö":45.77,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:34","sisälämpö":46.23,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:35","sisälämpö":46.68,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:36","sisälämpö":47.11,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:37","sisälämpö":47.53,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:38","sisälämpö":47.94,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:39","sisälämpö":48.33,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:40","sisälämpö":48.71,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:41","sisälämpö":49.07,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:42","sisälämpö":49.43,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:43","sisälämpö":49.77,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:44","sisälämpö":50.1,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:45","sisälämpö":50.42,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:46","sisälämpö":50.73,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:47","sisälämpö":51.04,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:48","sisälämpö":51.33,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:49","sisälämpö":51.61,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:50","sisälämpö":51.88,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:51","sisälämpö":52.14,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:52","sisälämpö":52.4,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:53","sisälämpö":52.65,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:54","sisälämpö":52.88,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:55","sisälämpö":53.11,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:56","sisälämpö":53.34,"Listeria":null,"Salmonella":null},{"aika":"18.06.2022 14:57","sisälämpö":53.55,"Listeria":null,"Salmonella":"0.22"},{"aika":"18.06.2022 14:58","sisälämpö":53.76,"Listeria":null,"Salmonella":"0.24"},{"aika":"18.06.2022 14:59","sisälämpö":53.97,"Listeria":null,"Salmonella":"0.27"},{"aika":"18.06.2022 15:00","sisälämpö":54.16,"Listeria":null,"Salmonella":"0.30"},{"aika":"18.06.2022 15:01","sisälämpö":54.35,"Listeria":"0.17","Salmonella":"0.32"},{"aika":"18.06.2022 15:02","sisälämpö":54.53,"Listeria":"0.19","Salmonella":"0.35"},{"aika":"18.06.2022 15:03","sisälämpö":54.71,"Listeria":"0.21","Salmonella":"0.39"},{"aika":"18.06.2022 15:04","sisälämpö":54.88,"Listeria":"0.23","Salmonella":"0.42"},{"aika":"18.06.2022 15:05","sisälämpö":55.05,"Listeria":"0.26","Salmonella":"0.46"},{"aika":"18.06.2022 15:06","sisälämpö":55.21,"Listeria":"0.28","Salmonella":"0.50"},{"aika":"18.06.2022 15:07","sisälämpö":55.37,"Listeria":"0.31","Salmonella":"0.54"},{"aika":"18.06.2022 15:08","sisälämpö":55.52,"Listeria":"0.33","Salmonella":"0.58"},{"aika":"18.06.2022 15:09","sisälämpö":55.66,"Listeria":"0.36","Salmonella":"0.63"},{"aika":"18.06.2022 15:10","sisälämpö":55.8,"Listeria":"0.39","Salmonella":"0.67"},{"aika":"18.06.2022 15:11","sisälämpö":55.94,"Listeria":"0.42","Salmonella":"0.72"},{"aika":"18.06.2022 15:12","sisälämpö":56.07,"Listeria":"0.46","Salmonella":"0.78"},{"aika":"18.06.2022 15:13","sisälämpö":56.2,"Listeria":"0.49","Salmonella":"0.83"},{"aika":"18.06.2022 15:14","sisälämpö":56.32,"Listeria":"0.53","Salmonella":"0.89"},{"aika":"18.06.2022 15:15","sisälämpö":56.44,"Listeria":"0.57","Salmonella":"0.95"},{"aika":"18.06.2022 15:16","sisälämpö":56.56,"Listeria":"0.61","Salmonella":"1.01"},{"aika":"18.06.2022 15:17","sisälämpö":56.67,"Listeria":"0.66","Salmonella":"1.08"},{"aika":"18.06.2022 15:18","sisälämpö":56.78,"Listeria":"0.70","Salmonella":"1.14"},{"aika":"18.06.2022 15:19","sisälämpö":56.88,"Listeria":"0.75","Salmonella":"1.21"},{"aika":"18.06.2022 15:20","sisälämpö":56.98,"Listeria":"0.80","Salmonella":"1.29"},{"aika":"18.06.2022 15:21","sisälämpö":57.08,"Listeria":"0.85","Salmonella":"1.36"},{"aika":"18.06.2022 15:22","sisälämpö":57.17,"Listeria":"0.90","Salmonella":"1.44"},{"aika":"18.06.2022 15:23","sisälämpö":57.27,"Listeria":"0.96","Salmonella":"1.52"},{"aika":"18.06.2022 15:24","sisälämpö":57.36,"Listeria":"1.02","Salmonella":"1.60"},{"aika":"18.06.2022 15:25","sisälämpö":57.44,"Listeria":"1.08","Salmonella":"1.69"},{"aika":"18.06.2022 15:26","sisälämpö":57.52,"Listeria":"1.14","Salmonella":"1.78"},{"aika":"18.06.2022 15:27","sisälämpö":57.6,"Listeria":"1.20","Salmonella":"1.87"},{"aika":"18.06.2022 15:28","sisälämpö":57.68,"Listeria":"1.27","Salmonella":"1.96"},{"aika":"18.06.2022 15:29","sisälämpö":57.76,"Listeria":"1.33","Salmonella":"2.06"},{"aika":"18.06.2022 15:30","sisälämpö":57.83,"Listeria":"1.40","Salmonella":"2.16"},{"aika":"18.06.2022 15:31","sisälämpö":57.9,"Listeria":"1.47","Salmonella":"2.26"},{"aika":"18.06.2022 15:32","sisälämpö":57.97,"Listeria":"1.55","Salmonella":"2.36"},{"aika":"18.06.2022 15:33","sisälämpö":58.03,"Listeria":"1.62","Salmonella":"2.47"},{"aika":"18.06.2022 15:34","sisälämpö":58.1,"Listeria":"1.70","Salmonella":"2.57"},{"aika":"18.06.2022 15:35","sisälämpö":58.16,"Listeria":"1.78","Salmonella":"2.69"},{"aika":"18.06.2022 15:36","sisälämpö":58.22,"Listeria":"1.86","Salmonella":"2.80"},{"aika":"18.06.2022 15:37","sisälämpö":58.28,"Listeria":"1.95","Salmonella":"2.91"},{"aika":"18.06.2022 15:38","sisälämpö":58.33,"Listeria":"2.03","Salmonella":"3.03"},{"aika":"18.06.2022 15:39","sisälämpö":58.39,"Listeria":"2.12","Salmonella":"3.15"},{"aika":"18.06.2022 15:40","sisälämpö":58.44,"Listeria":"2.21","Salmonella":"3.27"},{"aika":"18.06.2022 15:41","sisälämpö":58.49,"Listeria":"2.30","Salmonella":"3.40"},{"aika":"18.06.2022 15:42","sisälämpö":58.54,"Listeria":"2.39","Salmonella":"3.53"},{"aika":"18.06.2022 15:43","sisälämpö":58.59,"Listeria":"2.49","Salmonella":"3.66"},{"aika":"18.06.2022 15:44","sisälämpö":58.63,"Listeria":"2.58","Salmonella":"3.79"},{"aika":"18.06.2022 15:45","sisälämpö":58.68,"Listeria":"2.68","Salmonella":"3.92"},{"aika":"18.06.2022 15:46","sisälämpö":58.72,"Listeria":"2.78","Salmonella":"4.06"},{"aika":"18.06.2022 15:47","sisälämpö":58.76,"Listeria":"2.88","Salmonella":"4.19"},{"aika":"18.06.2022 15:48","sisälämpö":58.8,"Listeria":"2.99","Salmonella":"4.33"},{"aika":"18.06.2022 15:49","sisälämpö":58.84,"Listeria":"3.09","Salmonella":"4.47"},{"aika":"18.06.2022 15:50","sisälämpö":58.88,"Listeria":"3.20","Salmonella":"4.62"},{"aika":"18.06.2022 15:51","sisälämpö":58.91,"Listeria":"3.31","Salmonella":"4.76"},{"aika":"18.06.2022 15:52","sisälämpö":58.95,"Listeria":"3.42","Salmonella":"4.91"},{"aika":"18.06.2022 15:53","sisälämpö":58.98,"Listeria":"3.53","Salmonella":"5.06"},{"aika":"18.06.2022 15:54","sisälämpö":59.02,"Listeria":"3.64","Salmonella":"5.21"},{"aika":"18.06.2022 15:55","sisälämpö":59.05,"Listeria":"3.76","Salmonella":"5.36"},{"aika":"18.06.2022 15:56","sisälämpö":59.08,"Listeria":"3.87","Salmonella":"5.51"},{"aika":"18.06.2022 15:57","sisälämpö":59.11,"Listeria":"3.99","Salmonella":"5.67"},{"aika":"18.06.2022 15:58","sisälämpö":59.14,"Listeria":"4.11","Salmonella":"5.83"},{"aika":"18.06.2022 15:59","sisälämpö":59.17,"Listeria":"4.23","Salmonella":"5.98"},{"aika":"18.06.2022 16:00","sisälämpö":59.19,"Listeria":"4.35","Salmonella":"6.14"},{"aika":"18.06.2022 16:01","sisälämpö":59.22,"Listeria":"4.47","Salmonella":"6.31"},{"aika":"18.06.2022 16:02","sisälämpö":59.24,"Listeria":"4.59","Salmonella":"6.47"},{"aika":"18.06.2022 16:03","sisälämpö":59.27,"Listeria":"4.72","Salmonella":"6.63"},{"aika":"18.06.2022 16:04","sisälämpö":59.29,"Listeria":"4.85","Salmonella":"6.80"},{"aika":"18.06.2022 16:05","sisälämpö":59.32,"Listeria":"4.97","Salmonella":"6.97"},{"aika":"18.06.2022 16:06","sisälämpö":59.34,"Listeria":"5.10","Salmonella":"7.14"},{"aika":"18.06.2022 16:07","sisälämpö":59.36,"Listeria":"5.23","Salmonella":"7.31"},{"aika":"18.06.2022 16:08","sisälämpö":59.38,"Listeria":"5.36","Salmonella":"7.48"},{"aika":"18.06.2022 16:09","sisälämpö":59.4,"Listeria":"5.49","Salmonella":"7.65"},{"aika":"18.06.2022 16:10","sisälämpö":59.42,"Listeria":"5.63","Salmonella":"7.82"},{"aika":"18.06.2022 16:11","sisälämpö":59.44,"Listeria":"5.76","Salmonella":"8.00"},{"aika":"18.06.2022 16:12","sisälämpö":59.46,"Listeria":"5.90","Salmonella":"8.17"},{"aika":"18.06.2022 16:13","sisälämpö":59.47,"Listeria":"6.03","Salmonella":"8.35"},{"aika":"18.06.2022 16:14","sisälämpö":59.49,"Listeria":"6.17","Salmonella":"8.53"},{"aika":"18.06.2022 16:15","sisälämpö":59.51,"Listeria":"6.31","Salmonella":"8.71"},{"aika":"18.06.2022 16:16","sisälämpö":59.52,"Listeria":"6.45","Salmonella":"8.89"},{"aika":"18.06.2022 16:17","sisälämpö":59.54,"Listeria":"6.59","Salmonella":"9.07"},{"aika":"18.06.2022 16:18","sisälämpö":59.55,"Listeria":"6.73","Salmonella":"9.25"},{"aika":"18.06.2022 16:19","sisälämpö":59.57,"Listeria":"6.87","Salmonella":"9.44"},{"aika":"18.06.2022 16:20","sisälämpö":59.58,"Listeria":"7.01","Salmonella":"9.62"},{"aika":"18.06.2022 16:21","sisälämpö":59.6,"Listeria":"7.15","Salmonella":"9.80"},{"aika":"18.06.2022 16:22","sisälämpö":59.61,"Listeria":"7.30","Salmonella":"9.99"},{"aika":"18.06.2022 16:23","sisälämpö":59.62,"Listeria":"7.44","Salmonella":"10.18"},{"aika":"18.06.2022 16:24","sisälämpö":59.63,"Listeria":"7.58","Salmonella":"10.36"},{"aika":"18.06.2022 16:25","sisälämpö":59.65,"Listeria":"7.73","Salmonella":"10.55"},{"aika":"18.06.2022 16:26","sisälämpö":59.66,"Listeria":"7.88","Salmonella":"10.74"},{"aika":"18.06.2022 16:27","sisälämpö":59.67,"Listeria":"8.02","Salmonella":"10.93"},{"aika":"18.06.2022 16:28","sisälämpö":59.68,"Listeria":"8.17","Salmonella":"11.12"},{"aika":"18.06.2022 16:29","sisälämpö":59.69,"Listeria":"8.32","Salmonella":"11.31"},{"aika":"18.06.2022 16:30","sisälämpö":59.7,"Listeria":"8.47","Salmonella":"11.51"},{"aika":"18.06.2022 16:31","sisälämpö":59.71,"Listeria":"8.62","Salmonella":"11.70"},{"aika":"18.06.2022 16:32","sisälämpö":59.72,"Listeria":"8.77","Salmonella":"11.89"},{"aika":"18.06.2022 16:33","sisälämpö":59.73,"Listeria":"8.92","Salmonella":"12.09"},{"aika":"18.06.2022 16:34","sisälämpö":59.74,"Listeria":"9.07","Salmonella":"12.28"},{"aika":"18.06.2022 16:35","sisälämpö":59.75,"Listeria":"9.22","Salmonella":"12.48"},{"aika":"18.06.2022 16:36","sisälämpö":59.75,"Listeria":"9.38","Salmonella":"12.67"},{"aika":"18.06.2022 16:37","sisälämpö":59.76,"Listeria":"9.53","Salmonella":"12.87"},{"aika":"18.06.2022 16:38","sisälämpö":59.77,"Listeria":"9.68","Salmonella":"13.06"},{"aika":"18.06.2022 16:39","sisälämpö":59.78,"Listeria":"9.84","Salmonella":"13.26"},{"aika":"18.06.2022 16:40","sisälämpö":59.78,"Listeria":"9.99","Salmonella":"13.46"},{"aika":"18.06.2022 16:41","sisälämpö":59.79,"Listeria":"10.14","Salmonella":"13.66"},{"aika":"18.06.2022 16:42","sisälämpö":59.8,"Listeria":"10.30","Salmonella":"13.86"},{"aika":"18.06.2022 16:43","sisälämpö":59.8,"Listeria":"10.45","Salmonella":"14.06"},{"aika":"18.06.2022 16:44","sisälämpö":59.81,"Listeria":"10.61","Salmonella":"14.26"},{"aika":"18.06.2022 16:45","sisälämpö":59.82,"Listeria":"10.77","Salmonella":"14.46"},{"aika":"18.06.2022 16:46","sisälämpö":59.82,"Listeria":"10.92","Salmonella":"14.66"},{"aika":"18.06.2022 16:47","sisälämpö":59.83,"Listeria":"11.08","Salmonella":"14.86"},{"aika":"18.06.2022 16:48","sisälämpö":59.83,"Listeria":"11.24","Salmonella":"15.06"},{"aika":"18.06.2022 16:49","sisälämpö":59.84,"Listeria":"11.40","Salmonella":"15.26"},{"aika":"18.06.2022 16:50","sisälämpö":59.85,"Listeria":"11.55","Salmonella":"15.46"},{"aika":"18.06.2022 16:51","sisälämpö":59.85,"Listeria":"11.71","Salmonella":"15.67"},{"aika":"18.06.2022 16:52","sisälämpö":59.85,"Listeria":"11.87","Salmonella":"15.87"},{"aika":"18.06.2022 16:53","sisälämpö":59.86,"Listeria":"12.03","Salmonella":"16.07"},{"aika":"18.06.2022 16:54","sisälämpö":59.86,"Listeria":"12.19","Salmonella":"16.27"},{"aika":"18.06.2022 16:55","sisälämpö":59.87,"Listeria":"12.35","Salmonella":"16.48"},{"aika":"18.06.2022 16:56","sisälämpö":59.87,"Listeria":"12.51","Salmonella":"16.68"},{"aika":"18.06.2022 16:57","sisälämpö":59.88,"Listeria":"12.67","Salmonella":"16.89"},{"aika":"18.06.2022 16:58","sisälämpö":59.88,"Listeria":"12.83","Salmonella":"17.09"},{"aika":"18.06.2022 16:59","sisälämpö":59.88,"Listeria":"12.99","Salmonella":"17.30"},{"aika":"18.06.2022 17:00","sisälämpö":59.89,"Listeria":"13.15","Salmonella":"17.50"},{"aika":"18.06.2022 17:01","sisälämpö":59.89,"Listeria":"13.31","Salmonella":"17.71"},{"aika":"18.06.2022 17:02","sisälämpö":59.9,"Listeria":"13.47","Salmonella":"17.91"}];
     chart.dateFormatter.inputDateFormat = "dd.MM.yyyy HH:mm";
     chart.dateFormatter.dateFormat = "dd.MM HH:mm";

     var dateAxis = chart.xAxes.push(new am4charts.DateAxis());
     dateAxis.renderer.minGridDistance = 60;
     dateAxis.renderer.labels.template.fontSize = 20;
     dateAxis.renderer.minGridDistance = 50;
     dateAxis.renderer.line.strokeOpacity = 1;
     dateAxis.renderer.line.strokeWidth = 2;
     dateAxis.renderer.line.stroke = am4core.color("#3787ac");

     var valueAxis1 = chart.yAxes.push(new am4charts.ValueAxis());
    valueAxis1.tooltip.disabled = false;
     valueAxis1.renderer.labels.template.fontSize = 20;
     valueAxis1.renderer.labels.template.fontBold = true;
     valueAxis1.renderer.minWidth = 60;
     valueAxis1.max = 100;
     valueAxis1.title.text = "Sisälämpötila°C";
     valueAxis1.title.fontWeight = "bold";
     valueAxis1.title.fontSize = 20;
     valueAxis1.renderer.line.strokeOpacity = 1;
     valueAxis1.renderer.line.strokeWidth = 2;
     valueAxis1.renderer.line.stroke = am4core.color("#3787ac");


     var valueAxis2 = chart.yAxes.push(new am4charts.ValueAxis());
     valueAxis2.renderer.opposite = true;
     valueAxis2.syncWithAxis = valueAxis1;
     valueAxis2.logarithmic = false;
     valueAxis2.min = 1;
     valueAxis2.title.text = "Bakteerien Log10 vähennys";
     valueAxis2.title.fontWeight = "bold";
     valueAxis2.title.fontSize = 20;

     var series1 = chart.series.push(new am4charts.LineSeries());
     series1.name = "Sisälämpö";
     series1.dataFields.valueY = "sisälämpö";
     series1.dataFields.dateX = "aika";
     series1.tooltipText = "[bold] Sisälämpö:{sisälämpö}°C"
     series1.tooltip.getFillFromObject = false;
     series1.tooltip.background.fill = am4core.color("#FF0000");
     series1.fill = am4core.color("#FF0000");
     series1.stroke = am4core.color("#FF0000");
     series1.strokeWidth = 3;
     series1.tensionX = 0.8;

     var series2 = chart.series.push(new am4charts.LineSeries());
     series2.name = "Listeria";
     series2.dataFields.valueY = "Listeria";
     series2.dataFields.dateX = "aika";
     series2.tooltipText = "[bold] Listeria:{Listeria}";
     series2.yAxis = valueAxis2;
     series2.tooltip.getFillFromObject = false;
     series2.tooltip.background.fill = am4core.color("#0000FF");
     series2.fill = am4core.color("#0000FF");
     series2.stroke = am4core.color("#0000FF");
     series2.strokeWidth = 3;

     var series3 = chart.series.push(new am4charts.LineSeries());
     series3.name = "Salmonella";
     series3.dataFields.valueY = "Salmonella";
     series3.dataFields.dateX = "aika";
     series3.tooltipText ="[bold] Salmonella:{Salmonella}";
     series3.yAxis = valueAxis2;
     series3.tooltip.getFillFromObject = false;
     series3.tooltip.background.fill = am4core.color("#F1C40F");
     series3.fill = am4core.color("#F1C40F");
     series3.stroke = am4core.color("#F1C40F");
     series3.strokeWidth = 3;

     chart.cursor = new am4charts.XYCursor();

     chart.legend = new am4charts.Legend();
     chart.legend.postition="bottom"
     series1.legendSettings.labelText = "[bold {color}]{name} °C[/]";
     series1.legendSettings.labelText.fontSize = 25;
     series1.legendSettings.valueText = "{valueY.close}";
     series1.legendSettings.itemValueText = "[bold {color}]{valueY}[/bold]";

     series2.legendSettings.labelText = "[bold {color}]{name} Log10[/]";
     series2.legendSettings.labelText.fontSize = 25;
     series2.legendSettings.valueText = "{valueY.close}";
     series2.legendSettings.itemValueText = "[bold {color}]{valueY}[/bold]";

     series3.legendSettings.labelText = "[bold {color}]{name} Log10[/]";
     series3.legendSettings.labelText.fontSize = 25;
     series3.legendSettings.valueText = "{valueY.close}";
     series3.legendSettings.itemValueText = "[bold {color}]{valueY}[/bold]";

     //chart.scrollbarY = new am4core.Scrollbar();
     chart.scrollbarX = new am4core.Scrollbar();

     var range = valueAxis1.axisRanges.create();
     range.value = 60;
     range.grid.stroke = am4core.color("#396478");
     range.grid.strokeWidth = 3;
     range.grid.strokeOpacity = 0.5;
     range.label.inside = true;
     range.label.text = "Sisälämpötavoite 60°C";
     range.label.fill = range.grid.stroke;
     range.label.align = "left";
     range.label.verticalCenter = "top";

     let range2 = valueAxis2.axisRanges.create();
     range2.value = 5;
     range2.endValue = 7.5;
     range2.axisFill.fill = am4core.color("#396478");
     range2.axisFill.fillOpacity = 0.2;
     range2.grid.strokeOpacity = 0;

     let range3 = valueAxis1.axisRanges.create();
     range3.value = 100;
     range3.label.inside = true;
     range3.label.text = "Minimi tavoitteet:\nE.Coli Log10 =5\nListeria Log10= 6\nE.Coli Log10 =5\nSalmonella siipikarja Log10=7\nSalmonella muut Log10=6.5";
     //range3.label.fill = range3.grid.stroke;
     range3.label.fill = am4core.color("#F1C40F");
     range3.label.align = "left";
     range3.label.verticalCenter = "top";
});
</script>

template code

<style id="dashboard-styles-override">
   .nr-dashboard-theme md-select-menu md-option {
        background-color: var(--nr-dashboard-groupBorderColor);
        color: #eeeeee;
        height: 29px;
       /* border-radius: 14px;*/
        margin-left: 10px;
        margin-right: 10px;
        margin-top: 2px;
        box-shadow: 0 0 6px 6px #24202133;
        transition: 0.3s;
    }
    .nr-dashboard-theme md-select-menu md-option[selected] {
        color: var(--nr-dashboard-widgetTextColor) !important;
        background-color: var(--nr-dashboard-widgetColor) !important;
    }
    .nr-dashboard-theme md-select-menu md-option:nth-child(even) {
        background-color: var(--nr-dashboard-groupBorderColor);
        opacity:0.8;
    }
    .nr-dashboard-theme md-select-menu md-option:last-child {
       margin-bottom: 8px;
    }
    .nr-dashboard-theme md-select-menu md-option:hover {
        background-color: var(--nr-dashboard-widgetBackgroundColor) !important;
        padding-left: 24px;
    }
    .nr-dashboard-theme md-select-menu md-option > .md-ripple-container{
        /* border-radius: 14px;*/
    }
    .md-button{
        font-size:10px;
        line-height:normal;
    }
        #Tikku1_Ennuste1_cards > md-card {
        background-color:rgba(255,255,255,0.8) !important;
        //background-color: #ffbb00 !important;
    }
    
</style>

template node

If you wan them to have same color as the series, then why do you even set them manually?

If you turn getFillFromObject to true does it change anything?

https://www.amcharts.com/docs/v4/concepts/tooltips/

Fill

Tooltips that are displayed over specific element will "inherit" its color, or more precisely fill value.

This is why our tooltip for title in the example above came out as black - the title itself is black.

If we want to set our own color for the tooltip we need to first disable the inheritance, then set fill to tooltip's background.

The fill object tooltip is controlled by its getFillFromObject property, and it's true by default. To disable such inheritance, we need to set it to false

chart.tooltip.getFillFromObject = false;
chart.tooltip.background.fill = am4core.color("#67b7dc");

If you look that first pic in my post you see everything is Ok.
If you copy my chart code in template code and save it .html you see that all works
But same code in node red changing backgrounds of tooltips to blue.
I use dark theme and base color is blue.

I probably know what is the root cause but as I'm away from computers for tonight I can't check it. But you can.

From the document:
As we already mentioned a number of times, tooltip contents can either be set via tooltipText or tooltipHTML.

Setting tooltipText will produce tooltips using SVG.

As far I know:
Inside template node all the path elements of the SVG will be treated with higher specificity CSS rule and attempts to make overrides will fail.

But if you try with the tooltipHTML option the SVG is avoided and it may do the trick

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.