Jump to content

Recommended Posts

Hello!

To change the color you need to use additional JS code. It will parse the data in chart and change the color according to name of the column.
Here is the code:

<script type="text/javascript">
document.addEventListener('DataPageReady', chartUpdateHandler);

function chartUpdateHandler(event) {
  
 var cleaner = function(interv) {
  clearInterval(interv);
 } 

 let interv = setInterval(() => {
  if (!!Highcharts) {
   const options = Highcharts.charts[0].series[0].data;
   let data = []; 

   options.forEach(option => {
      let localData = {};
      localData.y = option.y;
      localData.name = option.name; 

      if(option.name === "(blank)") {
       localData.color = '#ee5921';
      } else {
       localData.color = '#3186AD';
      } 

      data.push(localData);
     })   

     Highcharts.charts[0].update({
      series: {
       data: data
       }    
    });
    cleaner(interv);
  } 
 }, 200);
}
</script>

You need to insert this code into the Header of the report DataPage. Do not forget to disable the HTML editor.

Link to post
Share on other sites

Hello, you can also try getting the nth child but will be a static change of color display. But since the chart will always return the blank in the first line, we can always modify the 1st one to be set as orange. Try pasting this to the header as well:

<style>

rect.highcharts-point.highcharts-color-0:nth-child(1) {
    fill: #ffd3a8;
}

</style>

 

If you want  to also apply different colors to the other values, change the bold number to any desired  displayed number  and it should work as expected. 

Link to post
Share on other sites
2 hours ago, SinJunYoung said:

Hello, you can also try getting the nth child but will be a static change of color display. But since the chart will always return the blank in the first line, we can always modify the 1st one to be set as orange. Try pasting this to the header as well:

<style>

rect.highcharts-point.highcharts-color-0:nth-child(1) {
    fill: #ffd3a8;
}

</style>

 

If you want  to also apply different colors to the other values, change the bold number to any desired  displayed number  and it should work as expected. 

Excellent solution, worked like a charm.  Hastur's solution worked too, but seams to be resource intensive.  (Perhaps my machine just acted up..)   Thank you both!!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...