Articles in this section
Category / Section

How to apply the custom labels in WPF Charts LogarithmicAxis?

1 min read

You can apply the custom labels for LogarithmicAxis by adding the ChartAxisLabel class with  the LabelContent and Position properties to the CustomLabels collection property, which is available in ChartAxis. The following code sample demonstrates how to apply the custom labels for LogarithmicAxis.

C#:

LogarithmicAxis logarithmicAxis = new LogarithmicAxis ();
logarithmicAxis.LogarithmicBase = 10;
logarithmicAxis.Interval = 1;
logarithmicAxis.Minimum = 1;
logarithmicAxis.Maximum = 100000;
           
double logarithmicBase = logarithmicAxis.LogarithmicBase;
ChartAxisLabel hundred= new ChartAxisLabel();
hundred.Position = Math.Round(Math.Log(100, logarithmicBase), 3);
hundred.LabelContent = "Hundred";
logarithmicAxis.CustomLabels.Add(hundred);
 
ChartAxisLabel fiveHundred = new ChartAxisLabel();
fiveHundred.Position = Math.Round(Math.Log(500, logarithmicBase), 3);
fiveHundred.LabelContent = "Five Hundred";
logarithmicAxis.CustomLabels.Add(fiveHundred);
 
ChartAxisLabel thousand = new ChartAxisLabel();
thousand.Position = Math.Round(Math.Log(1000, logarithmicBase), 3);
thousand.LabelContent = "Thousand ";
logarithmicAxis.CustomLabels.Add(thousand);
 
Chart.SecondaryAxis = logarithmicAxis;

Output:

Chart logarithmic axis with custom labels in WPF

Conclusion

I hope you enjoyed learning about how to apply the custom labels in WPF Charts LogarithmicAxis.

You can refer to our WPF Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF Chart example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied