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

Message ListMessage List     Post MessagePost Message

  Help with second y axis label
Posted by Michael on May-30-2011 07:14
Attachments:
Hi all,

I'm having some problems with my yAxis2 labels. The first image is the graph I am trying to duplicate and the second is the graph I currently have. This is my code (C# windows forms);

            double[] Q0Data = {1};
            double[] Q1Data = {26};
            double[] Q2Data = {73};
            double[] Q3Data = {173};
            double[] Q4Data = {2074};
            double[] qmax = { 59 };

            XYChart c = new XYChart(240, 400);

            c.setPlotArea(40, 20, 150, 300).setGridColor(0xc0c0c0, 0xc0c0c0);

            c.addTitle("Test");

            c.yAxis().setLabelStyle("Arial Bold");
            c.yAxis().setLogScale3();
            c.yAxis().setAutoScale(0, 0);

            c.syncYAxis();

            c.yAxis().setLabelStyle("Arial Bold");
            c.yAxis().setLogScale(1,5000);
            c.yAxis().setAutoScale(0, 0, 0);
            c.yAxis2().addLabel(1, "1");
            c.yAxis2().addLabel(26, "26");
            c.yAxis2().addLabel(59, "59");
            c.yAxis2().addLabel(73, "73");
            c.yAxis2().addLabel(173, "173");
            c.yAxis2().addLabel(2074, "2074");

            BoxWhiskerLayer bwl = new BoxWhiskerLayer();

            bwl = c.addBoxWhiskerLayer(Q3Data, Q1Data, Q4Data, Q0Data, Q2Data, 0x9999ff, 0x0000cc);
            bwl.setLineWidth(2);
            bwl.setDataGap(0.7);
            bwl.addDataSet(qmax, 0xff0000);
            bwl.addExtraField(qmax);

            winChartViewer1.Image = c.makeImage();

I am trying to get the following labels on the yAxis2 (1,26,59, 73,173, 2074) however when I don't use syncYAxis the labels are out of position, and when I do use syncYAxis the labels are in the correct spot but are overwritten by the yAxis labels.

Hopefully it's something small i've missed.

Can anyone point me in the right direction?

Any help is appreciated,
Michael.
TargetGraph.JPG
GraphDevelopment.JPG

  Re: Help with second y axis label
Posted by Michael on May-30-2011 09:20
Please ignore this block, it shouldn't have been in there;

            c.yAxis().setLabelStyle("Arial Bold");
            c.yAxis().setLogScale(1,5000);
            c.yAxis().setAutoScale(0, 0, 0);

Cheers.
Michael wrote:

Hi all,

I'm having some problems with my yAxis2 labels. The first image is the graph I am trying to duplicate and the second is the graph I currently have. This is my code (C# windows forms);

            double[] Q0Data = {1};
            double[] Q1Data = {26};
            double[] Q2Data = {73};
            double[] Q3Data = {173};
            double[] Q4Data = {2074};
            double[] qmax = { 59 };

            XYChart c = new XYChart(240, 400);

            c.setPlotArea(40, 20, 150, 300).setGridColor(0xc0c0c0, 0xc0c0c0);

            c.addTitle("Test");

            c.yAxis().setLabelStyle("Arial Bold");
            c.yAxis().setLogScale3();
            c.yAxis().setAutoScale(0, 0);

            c.syncYAxis();

            c.yAxis2().addLabel(1, "1");
            c.yAxis2().addLabel(26, "26");
            c.yAxis2().addLabel(59, "59");
            c.yAxis2().addLabel(73, "73");
            c.yAxis2().addLabel(173, "173");
            c.yAxis2().addLabel(2074, "2074");

            BoxWhiskerLayer bwl = new BoxWhiskerLayer();

            bwl = c.addBoxWhiskerLayer(Q3Data, Q1Data, Q4Data, Q0Data, Q2Data, 0x9999ff, 0x0000cc);
            bwl.setLineWidth(2);
            bwl.setDataGap(0.7);
            bwl.addDataSet(qmax, 0xff0000);
            bwl.addExtraField(qmax);

            winChartViewer1.Image = c.makeImage();

I am trying to get the following labels on the yAxis2 (1,26,59, 73,173, 2074) however when I don't use syncYAxis the labels are out of position, and when I do use syncYAxis the labels are in the correct spot but are overwritten by the yAxis labels.

Hopefully it's something small i've missed.

Can anyone point me in the right direction?

Any help is appreciated,
Michael.

  Re: Help with second y axis label
Posted by Michael on May-30-2011 09:31
Hi,

I worked it out. Please remove the thread.

Thanks,
Michael.