Scaling issue with Date/Time format

G

Guest

Use this code to set the min/max.

set c=CS.constants
CS.charts(0).axes(c.chAxisPositionBottom).Scaling.Maximum
= X
CS.charts(0).axes(c.chAxisPositionBottom).Scaling.Minimum
= Y

Thao Moua
OWC Webchart Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
-----Original Message-----
I have a problem with the display of values on the x- axis.
The x-axis is a time-axis. The minimum value is not displayed at the extreme
left of the chart, and the maximum value is not displayed at the extreme right
of the chart either. See the image attached.
What is possible to do in order to have the whole width of the chart used for
the display ?



Here is the code below :

ChartSpace1 = new ChartSpaceClass();
ChartSpace1.Border.Color = "Black";
ChChart Chart1 = ChartSpace1.Charts.Add(0);
Chart1.Axes[0].HasTitle = true;
Chart1.Axes[0].Title.Caption = "Date";
Chart1.Axes[1].HasTitle = true;
Chart1.Axes[1].Title.Caption = "MW/h";
Chart1.HasLegend = true;
Chart1.Legend.Position=ChartLegendPositionEnum.chLegendPo
sitionBottom;

ChSeries Chart1_Series = Chart1.SeriesCollection.Add(0);
Chart1_Series.Type = ChartChartTypeEnum.chChartTypeScatterLine;
Chart1.SeriesCollection[0].Interior.Color = "Wheat";
Chart1_Series.SetData(
ChartDimensionsEnum.chDimSeriesNames,
Convert.ToInt32 (ChartSpecialDataSourcesEnum.chDataLiteral),
"Fermes");
Chart1_Series.SetData(
ChartDimensionsEnum.chDimXValues,
-1,
aX );

Chart1.Axes[1].NumberFormat = "dd/MM/yyyy";

Chart1.Axes[1].Orientation =
(int) ChartLabelOrientationEnum.chLabelOrientationDownward;
Chart1_Series.SetData(
ChartDimensionsEnum.chDimYValues,
-1,
aY );


How to set the minimum/maximum value of a time-axis ?
 
C

Christophe VOISIN

What are these X and Y values ?
The language used is C#. The Scaling.Minimum (maximum) properties expect a
double value. On a time-axis, what does this double value mean ?
Thanks a lot

Use this code to set the min/max.

set c=CS.constants
CS.charts(0).axes(c.chAxisPositionBottom).Scaling.Maximum
= X
CS.charts(0).axes(c.chAxisPositionBottom).Scaling.Minimum
= Y

Thao Moua
OWC Webchart Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

-----Original Message-----
I have a problem with the display of values on the x-
axis.

The x-axis is a time-axis. The minimum value is not

displayed at the extreme
left of the chart, and the maximum value is not

displayed at the extreme right
of the chart either. See the image attached.
What is possible to do in order to have the whole width

of the chart used for
the display ?



Here is the code below :

ChartSpace1 = new ChartSpaceClass();
ChartSpace1.Border.Color = "Black";
ChChart Chart1 = ChartSpace1.Charts.Add(0);
Chart1.Axes[0].HasTitle = true;
Chart1.Axes[0].Title.Caption = "Date";
Chart1.Axes[1].HasTitle = true;
Chart1.Axes[1].Title.Caption = "MW/h";
Chart1.HasLegend = true;

Chart1.Legend.Position=ChartLegendPositionEnum.chLegendPo

sitionBottom;


ChSeries Chart1_Series = Chart1.SeriesCollection.Add(0);
Chart1_Series.Type =
ChartChartTypeEnum.chChartTypeScatterLine;

Chart1.SeriesCollection[0].Interior.Color = "Wheat";
Chart1_Series.SetData(
ChartDimensionsEnum.chDimSeriesNames,
Convert.ToInt32
(ChartSpecialDataSourcesEnum.chDataLiteral),

"Fermes");
Chart1_Series.SetData(
ChartDimensionsEnum.chDimXValues,
-1,
aX );

Chart1.Axes[1].NumberFormat = "dd/MM/yyyy";

Chart1.Axes[1].Orientation =
(int)
ChartLabelOrientationEnum.chLabelOrientationDownward;

Chart1_Series.SetData(
ChartDimensionsEnum.chDimYValues,
-1,
aY );


How to set the minimum/maximum value of a time-axis ?
 
T

Thao Moua [ms]

X & Y are nothing more than variables used in my
examples.

On a timescale axis, from the UI perspective timescale
values are displayed as date values but internally they
are kept as numeric values. Query the max/min values and
then tweak the values (ie add/minus some value) until
your category is displayed correctly.

Thao Moua
OWC Webchart Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
-----Original Message-----
What are these X and Y values ?
The language used is C#. The Scaling.Minimum (maximum) properties expect a
double value. On a time-axis, what does this double value mean ?
Thanks a lot

Use this code to set the min/max.

set c=CS.constants
CS.charts(0).axes (c.chAxisPositionBottom).Scaling.Maximum
= X
CS.charts(0).axes (c.chAxisPositionBottom).Scaling.Minimum
= Y

Thao Moua
OWC Webchart Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

-----Original Message-----
I have a problem with the display of values on the x-
axis.

The x-axis is a time-axis. The minimum value is not

displayed at the extreme
left of the chart, and the maximum value is not

displayed at the extreme right
of the chart either. See the image attached.
What is possible to do in order to have the whole
width

of the chart used for
the display ?



Here is the code below :

ChartSpace1 = new ChartSpaceClass();
ChartSpace1.Border.Color = "Black";
ChChart Chart1 = ChartSpace1.Charts.Add(0);
Chart1.Axes[0].HasTitle = true;
Chart1.Axes[0].Title.Caption = "Date";
Chart1.Axes[1].HasTitle = true;
Chart1.Axes[1].Title.Caption = "MW/h";
Chart1.HasLegend = true;


Chart1.Legend.Position=ChartLegendPositionEnum.chLegend
Po

sitionBottom;
ChSeries Chart1_Series = Chart1.SeriesCollection.Add (0);
Chart1_Series.Type =
ChartChartTypeEnum.chChartTypeScatterLine;

Chart1.SeriesCollection[0].Interior.Color = "Wheat";
Chart1_Series.SetData(
ChartDimensionsEnum.chDimSeriesNames,
Convert.ToInt32
(ChartSpecialDataSourcesEnum.chDataLiteral),

"Fermes");
Chart1_Series.SetData(
ChartDimensionsEnum.chDimXValues,
-1,
aX );

Chart1.Axes[1].NumberFormat = "dd/MM/yyyy";

Chart1.Axes[1].Orientation =
(int)
ChartLabelOrientationEnum.chLabelOrientationDownward;

Chart1_Series.SetData(
ChartDimensionsEnum.chDimYValues,
-1,
aY );


How to set the minimum/maximum value of a time-axis ?

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top