how to custom X Axis chart parameter value color

Helo guys, i need help in customize X Axis.

i trying to create different symbol / Color when value is below 100% my target is something like this



what im already try to do is this from controller



<br> tags work fine but <p> Tags dont work as intended




3 Replies 1 reply marked as answer

SB Swetha Babu Syncfusion Team April 13, 2022 12:43 PM UTC

Hi Muqaffi,


Greetings from Syncfusion.


Query 1: I trying to create different symbols


We can achieve your requirement of adding a different symbol by using the Content property in Annotation. However, we have created a simple MVC application to demonstrate the same and it can be downloaded from the below link.


Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ChartSample826186285


Screenshot:



Query 2: <p> tag does not work


We do not have support for the <p> tag in the Chart component.


Kindly, revert us if you have any concerns.


Regards,

Swetha



MG Muqaffi Gusticahyo Adi Bhaskoro April 14, 2022 01:19 AM UTC

Hi  Swetha, Thanks for reply

can we change the symbol that appears according to X bar value ? 


like when the score not reach goal the symbol would be X

and when the score reach goal would be mark-tick 



SB Swetha Babu Syncfusion Team April 18, 2022 06:41 AM UTC

Hi Muqaffi,


Thank you for your response.


We have achieved your requirement by using the load event in the Chart component. We have changed the content of the annotation which satisfies the goal. However, we have created a simple MVC application to demonstrate the same and it can be downloaded from the below link.


Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ChartSample1474048372


Code Snippet:


  var x;

    var loaded = function (args) {

        var dataSource = args.chart.series[0].dataSource;

        for (var i = 0; i < dataSource.length; i++) {

            if (dataSource[i][args.chart.series[0].yName] > 5600) {

                x = dataSource[i][args.chart.series[0].xName];

                if (parseFloat(args.chart.annotations[i].x) === x) {

                    args.chart.annotations[i].content = "<div><img src='/Content/Chart/wrong.jpg' style='width: 41px; height: 41px' /></div>";

                }

            }

        }

    }


Screenshot:



Kindly, revert us if you have any concerns.


Regards,

Swetha


Marked as answer
Loader.
Up arrow icon