# Need help on draw Y-coordinates values using CDXYChartMBS

Hi All,

I am using CDXYChartMBS plugins to draw the chart bar.
X - Coordinates: (“0”, “10”, “20”, “30”, “35”, “50”, “65”,“70”, “80”, “90”, “100”)
Y - Coordinates: V, X, Y, Z

Please refer the below screenshot. One tweak is after 30 of x- coordinates next values are 35, 50 and 65. After 65 again x- coordinates are starting from 70, 80 and so on.

Below line of code and data i am using to draw the Y-Coordinates :
data: array(12.0, 38, 32, 35)
V: 32
X: 35
Y: 38
Z: 12

``call c.addBarLayer(data, colors).setBorderColor(CDXYChartMBS.kTransparent, CDXYChartMBS.barLighting(0.15, 1.0))``

However, the x-coordinates chart bar is not displaying correctly in the graph.

You are putting names on the labels to confuse people?

Hi Christian,

I have uploaded the chart bar graph. Could you please have a look and Names in the label as per my requirements.

I just see a scaling with 10 between the lines and you gave them labels.

Hi Christian,

Yes, scaling is 10 between the lines. However, As you see between 30 to 70, values are different ( “35”, “50”, “65”). How can I adjust the scaling? So that if X = 38 It will draw the chart bar properly.

Here is my test case:

Example:
Suppose X coordinate data are (0, 10, 20, 30, 35, 50, 65, 70, 80). I wanted different scaling in the chart bar for the above values.
As you see between 30 to 70, values are different ( “35”, “50”, “65”). How can I adjust the scaling?

Any help would greatly be appreciated.

We’ll ask the company making ChartDirector as I don’t know this.

Thanks, Christian for an update. Please notify us once there is an update.

We got a suggestion to use AddLabel method for custom label positions:

```' Add the labels labels = Array(0, 10, 20, 30, 35, 50, 65, 70, 80) For i = 0 to Ubound(labels) Call c.xAxis().addLabel(labels(i), labels(i)) Next```

I have never seen a Chart with X values of 0, 10, 20, 30, 35, 50, 65, 70, 80, always fixed increments (instead of 35, 40, instead of 65, 60).

I guess you are trying to instead of showing 35 on the 40 line, don’t want to show line at 40 but show line at 35 with label 35, the same with 65 instead of 60, right?

Some people like to add additional label and line to show where peak values are in a line chart.

That I understand. I was thinking that the OP wanted to remove 40 and 60, instead of adding 35 and 65.

he may need to make chart with no labels and than add all the custom labels as needed.

Here the sample code for adding three custom lines:

[code]// The data for the bar chart
dim data(-1) as double = array(85.0, 156, 179.5, 211, 123)

// The labels for the bar chart
dim labels(-1) as string = array(“Mon”, “Tue”, “Wed”, “Thu”, “Fri”)

// Create a XYChart object of size 250 x 250 pixels
dim c as new CDXYChartMBS(250, 250)

// Set the plotarea at (30, 20) and of size 200 x 200 pixels
call c.setPlotArea(30, 20, 200, 200)

// Add a bar chart layer using the given data

// Set the labels on the x axis.
Call c.xAxis.setLabels labels

Dim NoLabels() As String
Call c.yAxis.setLinearScale 0, 250, NoLabels

// add custom labels