Click here to Skip to main content
14,938,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear friends,
I m developing a chart based software where my X-axis values are not evenly spaced something like below. I need to plot a line graph with following X-axis values and Y-axis is increasing from 0.1 to 1.5 taking random values. I also need every X-axis point as an X-value label for the axis.

Dim xPoints() As String = {"0.01", "0.05", "0.10", "0.20", "0.30", "2", "3", "4", "5", "10", "20", "30", "40","50", "60", "70", "80", "90", "100", "200", "300", "400", "500", "600", "700", "800","900", "1000"}

Please suggest to me a solution for the same.
Thanks in advance.

What I have tried:

I have tried various combinations of intervals and also putting the direct values of x and y but nothing works.
Updated 23-Dec-20 5:46am
Maciej Los 23-Dec-20 7:36am
Why, on earth, are you using string instead of proper data type?
Richard MacCutchan 23-Dec-20 8:37am
To expand on Maciej's comment. You should not be using xPoints at all. Your set should be a set of Point objects, each containing the x and y values (as proper numeric types). It then becomes easy to find the lowest and highest values, and to plot each point.

1 solution

If you're trying to do a histogram for say "gauge sizes", I see where you're going.

They're "group labels"; usually for a frequency chart.

c# - How to give custom labels to x axis of chart control? - Stack Overflow[^]

Histogram - Wikipedia[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900