Hi jhow,
You can put labels on the x-axis, and align the points with the labels. The points will still be using numbers as coordinates.
If the x-axis is a label based axis, the coordinate x = 0 will correspond to the first tick position (the first vertical grid line), the x = 1 will be the second tick position, and so on. You can use x = 0.5 to put a data point in between two ticks.
For your case, the labels are in between the grid lines, so the x-coordinates of the seven symbols in the chart can be { 0.5, 1.5, 1.5, 1.5, 2.5, 3.5, 3.5 }.
The following is one of the methods produce your chart (in C#):
... create chart object and set plot area size as usual ...
// 5 labels for 5 tick positions (the last label is not used in this chart)
string[] labels = { "Item1", "Item2", "Item3", "item4", "" };
c.xAxis().setLabels(labels);
// Shift the labels by 0.5 unit so that they are in between two ticks. The last label will
// be shifted out of the chart.
c.xAxis().setLabelOffset(0.5);
double[] x = { 0.5, 1.5, 1.5, 1.5, 2.5, 3.5, 3.5 };
double[] y = { ..... your y data values .....};
// Add the data points to the chart as a scatter layer
c.addScatterLayer(x, y, "", Chart.TriangleShape, 15, 0xff6600);
... output the chart ....
Hope this can help.
Regards
Peter Kwan |