BoldDeskWe are launching BoldDesk on Product Hunt soon.
Learn more & follow us.
Is there a way to extract the x-axis label values from a chart for use within the view?
I currently am able to extract the data, but I would also like to extract the x-axis labels for display in the view.
Thanks for using Syncfusion products.
We have prepared a sample based on your requirement. We can
get X-axis label through find the X-Axis visible Range min, max and interval
and calculate the label value based on this information.
Please find the below code snippet to achieve this.
//Find Min, Max and Interval Range
minX = chartModel.PrimaryXAxis.VisibleRange.Min;
maxX = chartModel.PrimaryXAxis.VisibleRange.Max;
intrvl = chartModel.PrimaryXAxis.VisibleRange.Interval;
X-Axis label to List
(minX < maxX)
minX = minX + intrvl;
X-Axis Label in View Page</b>
label in (List<double>)ViewData["label"])
Please download the sample with screenshot from the below
Please let us know your concerns.