ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  yAxis Decimal place issue
Posted by icm63 on Jul-26-2011 13:52
Attachments:
CODE : For Axis sync

        Dim dec as integer = 4


        'Y Axis
        c.yAxis().setLinearScale(minValue, maxValue, Spac)
        c.yAxis().setMultiFormat(Chart.RegularSpacingFilter(1, 0), "{value|" & dec & "}")
        'Sync RHS with leading LHS axis
        c.yAxis2().setMultiFormat2(Chart.RegularSpacingFilter(1, 0), "{value|" & dec & "}")
        c.syncYAxis(1, 0)


yAxis = Right hand side
yAxis2 = Left hand side

yet in the chart the right hand axis does not show 4 decimal places, there is enough room for the extra digit, yet it does not show up..

Any ideas
Issue1001.jpg

  Re: yAxis Decimal place issue
Posted by Peter Kwan on Jul-27-2011 01:41
Hi icm63,

I have just tried your code using the "Finance Chart (2)" sample code. It works normally in my case.

Is it possible you have another line of code somewhere that also sets the format of the y-axis (eg. using setLabelFormat, setMultiFormat, setMultiFormat2), or is it possible there is no sufficient space on the right side (so that the labels flow outside the XYChart)?

To diagnose the problem, is it possible to modify your code to:

        c.yAxis().setLinearScale(minValue, maxValue, Spac)
        c.syncYAxis(1, 0)
        c.setBackground(&Hffff00, &H000000)

The above code will print out the labels with as many decimal points as necessary, and it will draw a border on the chart. This allows us to see the border of the chart, so we can double check if there is sufficient space. It also enables us to verify if there may be another line of code that can affect the label format.

Regards
Peter Kwan

  Re: yAxis Decimal place issue
Posted by icm63 on Jul-27-2011 03:27
Thanks found it !

  Re: yAxis Decimal place issue
Posted by icm63 on Aug-02-2011 06:32
Attachments:
How can I manually set the diference between yAxis labels at what ever value I pre determine ??
yAxis.jpg

  Re: yAxis Decimal place issue
Posted by icm63 on Aug-02-2011 06:33
NOTE: Using the same code as in the first post...

  Re: yAxis Decimal place issue
Posted by Peter Kwan on Aug-02-2011 17:43
Hi icm63,

The y-axis difference is 1.5 because your code sets it to 1.5. If you want to set it to 1 or 2 or 2.5, please just set it to 1 or 2 ot 2.5.

In case you are not sure where in your code that you set the label difference, it is at:

c.yAxis().setLinearScale(minValue, maxValue, Spac)

The Spac is the difference between the y-axis labels. You can set it to any value you like.

Hope this can help.

Regards
Peter Kwan