Jump to content
Software FX Community

Setting X-axis values


User (Legacy)

Recommended Posts

I'm trying to draw a 5-series curve chart. My code segment looks as the

following. However, I just could not get X-axis use the first set of data,

even I set: DataType[0] = DataType.XValue.

Any suggestions? Thanks.

chart1.OpenData(COD.Values, 6, 200);

chart1.DataType[0] = DataType.XValue;

for (int i=1; i < 6; i++)

chart1.DataType[i] = DataType.Value;

for (int j=0; j < 200; j++)

chart1.Value[0, j] = MyData[0, j];

for (int i=1; i < 6; i++)

for (int j=0; j < 200; j++)

chart1.Value[i, j] = MyData[i, j];

chart1.CloseData(COD.Values);

Link to comment
Share on other sites

The DataType property is only used when you pass a recordset,array,etc and

we read the data from it, if you are passing the data manually you need to

use the XValue property

Chart.OpenData(COD.Values,2,5);

Chart.OpenData(COD.XValues,2,5);

for(i=0;i<2;i++)

for(j=0;j<5;j++) {

Chart.Value[i,j] = YourYValue;

Chart.XValue[i,j] = YourXValue;

}

Chart.CloseData(COD.Values);

Chart.CloseData(COD.XValues);

--

Regards,

JC

Software FX Support

"Youren Guo" <yguo@packardbioscience.com> wrote in message

news:801rQQzWCHA.1332@webserver1.softwarefx.com...

> I'm trying to draw a 5-series curve chart. My code segment looks as the

> following. However, I just could not get X-axis use the first set of data,

> even I set: DataType[0] = DataType.XValue.

>

> Any suggestions? Thanks.

>

>

>

>

>

> chart1.OpenData(COD.Values, 6, 200);

>

>

>

> chart1.DataType[0] = DataType.XValue;

>

> for (int i=1; i < 6; i++)

>

> chart1.DataType[i] = DataType.Value;

>

>

>

> for (int j=0; j < 200; j++)

>

> chart1.Value[0, j] = MyData[0, j];

>

>

>

> for (int i=1; i < 6; i++)

>

> for (int j=0; j < 200; j++)

>

> chart1.Value[i, j] = MyData[i, j];

>

>

>

> chart1.CloseData(COD.Values);

>

>

>

Link to comment
Share on other sites

Thanks for the reply. However, I have two questions regarding the way you

suggested:

(1) We have several hundreds of series (curves) to draw on the same chart,

and they all use the same set of Xvalues. Is there a simple way so that I

don't have to set the same set of Xvalues for all the series?

(2) With the way you suggested below, how could I get the AxisX to show the

labels using the Xvalues I set?

I tried setting: chart1.AxisX.DataFormat.Decimals = 3; and

chart1.AxisX.LabelsFormat.Decimals = 3; but the AxisX' labels only show as

"1.000, 2.000, 3.000, ...", not the Xvalues that I set.

Thanks.

"Software FX Support" <support@softwarefx.com> wrote in message

news:Nz1LsF0WCHA.3136@webserver1.softwarefx.com...

> The DataType property is only used when you pass a recordset,array,etc and

> we read the data from it, if you are passing the data manually you need to

> use the XValue property

>

> Chart.OpenData(COD.Values,2,5);

> Chart.OpenData(COD.XValues,2,5);

>

> for(i=0;i<2;i++)

> for(j=0;j<5;j++) {

> Chart.Value[i,j] = YourYValue;

> Chart.XValue[i,j] = YourXValue;

> }

>

> Chart.CloseData(COD.Values);

> Chart.CloseData(COD.XValues);

>

> --

> Regards,

>

> JC

> Software FX Support

Link to comment
Share on other sites

1) No. At this point you would have to assign the same Xvalues for all

series, I agree this is a waste of space and I will see if we can improve

this in a service pack or future release so that you can assign X date for

only one series and use it for all series.

2) After you assign the X values (using code similar to the one suggested)

you will have to change your gallery type to a chart that supports X values

(lines, scatter, etc.) Note that bar charts for example do not support X

values.

--

Regards,

JC

Software FX Support

"Youren Guo" <yguo@packardbioscience.com> wrote in message

news:O3FeZg2WCHA.3136@webserver1.softwarefx.com...

> Thanks for the reply. However, I have two questions regarding the way you

> suggested:

>

> (1) We have several hundreds of series (curves) to draw on the same chart,

> and they all use the same set of Xvalues. Is there a simple way so that I

> don't have to set the same set of Xvalues for all the series?

>

> (2) With the way you suggested below, how could I get the AxisX to show

the

> labels using the Xvalues I set?

> I tried setting: chart1.AxisX.DataFormat.Decimals = 3; and

> chart1.AxisX.LabelsFormat.Decimals = 3; but the AxisX' labels only show as

> "1.000, 2.000, 3.000, ...", not the Xvalues that I set.

>

> Thanks.

>

> "Software FX Support" <support@softwarefx.com> wrote in message

> news:Nz1LsF0WCHA.3136@webserver1.softwarefx.com...

> > The DataType property is only used when you pass a recordset,array,etc

and

> > we read the data from it, if you are passing the data manually you need

to

> > use the XValue property

> >

> > Chart.OpenData(COD.Values,2,5);

> > Chart.OpenData(COD.XValues,2,5);

> >

> > for(i=0;i<2;i++)

> > for(j=0;j<5;j++) {

> > Chart.Value[i,j] = YourYValue;

> > Chart.XValue[i,j] = YourXValue;

> > }

> >

> > Chart.CloseData(COD.Values);

> > Chart.CloseData(COD.XValues);

> >

> > --

> > Regards,

> >

> > JC

> > Software FX Support

>

>

>

Link to comment
Share on other sites

  • 5 months later...

Hello,

I tried the recommended code:

--

Chart.OpenData(COD.Values,2,5);

Chart.OpenData(COD.XValues,2,5);

for(i=0;i<2;i++)

...

--

But i can not see the COD.XValues property. Under COD i see:

AllocHidden,

NoAlloc,NoInvalidate,Remove,ScrollLegend,Unchange,Unknown,Values

there is no element named "XValues". Why?

I have the same problem... I need to show the datetime values at the x

axis. Anybody has a solution for this?

Regards,

Ziver

---

"Software FX Support" <support@softwarefx.com> wrote in message

news:Nz1LsF0WCHA.3136@webserver1.softwarefx.com...

> The DataType property is only used when you pass a recordset,array,etc and

> we read the data from it, if you are passing the data manually you need to

> use the XValue property

>

> Chart.OpenData(COD.Values,2,5);

> Chart.OpenData(COD.XValues,2,5);

>

> for(i=0;i<2;i++)

> for(j=0;j<5;j++) {

> Chart.Value[i,j] = YourYValue;

> Chart.XValue[i,j] = YourXValue;

> }

>

> Chart.CloseData(COD.Values);

> Chart.CloseData(COD.XValues);

>

> --

> Regards,

>

> JC

> Software FX Support

> "Youren Guo" <yguo@packardbioscience.com> wrote in message

> news:801rQQzWCHA.1332@webserver1.softwarefx.com...

> > I'm trying to draw a 5-series curve chart. My code segment looks as the

> > following. However, I just could not get X-axis use the first set of

data,

> > even I set: DataType[0] = DataType.XValue.

> >

> > Any suggestions? Thanks.

> >

> >

> >

> >

> >

> > chart1.OpenData(COD.Values, 6, 200);

> >

> >

> >

> > chart1.DataType[0] = DataType.XValue;

> >

> > for (int i=1; i < 6; i++)

> >

> > chart1.DataType[i] = DataType.Value;

> >

> >

> >

> > for (int j=0; j < 200; j++)

> >

> > chart1.Value[0, j] = MyData[0, j];

> >

> >

> >

> > for (int i=1; i < 6; i++)

> >

> > for (int j=0; j < 200; j++)

> >

> > chart1.Value[i, j] = MyData[i, j];

> >

> >

> >

> > chart1.CloseData(COD.Values);

> >

> >

> >

>

>

Link to comment
Share on other sites

NOTE: I am using ChartFX.Lite.

and i want to draw line graphs.

"Ziver Alen MALHASOGLU" <ziver_alenm@hotmail.com> wrote in message

news:DI0i12o1CHA.1304@webserver1.softwarefx.com...

> Hello,

>

> I tried the recommended code:

> --

> Chart.OpenData(COD.Values,2,5);

> Chart.OpenData(COD.XValues,2,5);

>

> for(i=0;i<2;i++)

> ...

> --

>

> But i can not see the COD.XValues property. Under COD i see:

> AllocHidden,

> NoAlloc,NoInvalidate,Remove,ScrollLegend,Unchange,Unknown,Values

>

> there is no element named "XValues". Why?

>

> I have the same problem... I need to show the datetime values at the x

> axis. Anybody has a solution for this?

>

> Regards,

> Ziver

> ---

>

> "Software FX Support" <support@softwarefx.com> wrote in message

> news:Nz1LsF0WCHA.3136@webserver1.softwarefx.com...

> > The DataType property is only used when you pass a recordset,array,etc

and

> > we read the data from it, if you are passing the data manually you need

to

> > use the XValue property

> >

> > Chart.OpenData(COD.Values,2,5);

> > Chart.OpenData(COD.XValues,2,5);

> >

> > for(i=0;i<2;i++)

> > for(j=0;j<5;j++) {

> > Chart.Value[i,j] = YourYValue;

> > Chart.XValue[i,j] = YourXValue;

> > }

> >

> > Chart.CloseData(COD.Values);

> > Chart.CloseData(COD.XValues);

> >

> > --

> > Regards,

> >

> > JC

> > Software FX Support

> > "Youren Guo" <yguo@packardbioscience.com> wrote in message

> > news:801rQQzWCHA.1332@webserver1.softwarefx.com...

> > > I'm trying to draw a 5-series curve chart. My code segment looks as

the

> > > following. However, I just could not get X-axis use the first set of

> data,

> > > even I set: DataType[0] = DataType.XValue.

> > >

> > > Any suggestions? Thanks.

> > >

> > >

> > >

> > >

> > >

> > > chart1.OpenData(COD.Values, 6, 200);

> > >

> > >

> > >

> > > chart1.DataType[0] = DataType.XValue;

> > >

> > > for (int i=1; i < 6; i++)

> > >

> > > chart1.DataType[i] = DataType.Value;

> > >

> > >

> > >

> > > for (int j=0; j < 200; j++)

> > >

> > > chart1.Value[0, j] = MyData[0, j];

> > >

> > >

> > >

> > > for (int i=1; i < 6; i++)

> > >

> > > for (int j=0; j < 200; j++)

> > >

> > > chart1.Value[i, j] = MyData[i, j];

> > >

> > >

> > >

> > > chart1.CloseData(COD.Values);

> > >

> > >

> > >

> >

> >

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...