OWC and time axis?

S

Striboldt

I'm trying to plot a chart where the category (x-axis) consists of values
witch can be the same. The data I would like to show could for instance look
like this:

x = "12:42:00", "12:42:00", "12:43:00", "12:43:00"
y = 4, 5, 6, 4

How do I plot this, so that all values are shown ?

Best regards,
Morten
 
A

Alvin Bruney

Probably the simplest way forward involves using a format mask on the
numberformat property of the axis in question. Ex:
..numberformat = "##:##:##" or one of the appriate format specifiers instead
of the format mask

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
S

Striboldt

I tried to use the numberformat, but gets this error:
Invalid Parameter at OWC11.ChAxis.set_NumberFormat(String pbstrNumberFormat)

This is my code:
strCategory = new System.Text.StringBuilder();
strCategory.Append("13:00:00" + '\t');
strCategory.Append("13:00:00" + '\t');
strCategory.Append("14:00:00" + '\t');
strCategory.Append("14:00:00" + '\t');

strValues = new System.Text.StringBuilder();
strValues.Append("1" + '\t');
strValues.Append("2" + '\t');
strValues.Append("3" + '\t');
strValues.Append("1" + '\t');

OWC11.ChartSpaceClass ChartSpace = new ChartSpaceClass();
ChartSpace.Charts.Add(0);
ChartSpace.Charts[0].SeriesCollection.Add(0);
ChartSpace.Charts[0].Type = ChartChartTypeEnum.chChartTypeColumnClustered;

ChartSpace.Charts[0].Axes[0].Scaling.Minimum = 0;
ChartSpace.Charts[0].Axes[0].Scaling.Maximum = 50;
ChartSpace.Charts[0].Axes[0].HasTickLabels = true;

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimSeriesNames,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "Uncorrectables");

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimCategories,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strCategory.ToString());

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimValues,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValues.ToString());

ChartSpace.Charts[0].Axes[ChartAxisTypeEnum.chCategoryAxis].NumberFormat =
"##:##:##";

Can you figure out what i'm doing wrong ?

Best regards,
Morten
Alvin Bruney said:
Probably the simplest way forward involves using a format mask on the
numberformat property of the axis in question. Ex:
..numberformat = "##:##:##" or one of the appriate format specifiers instead
of the format mask

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

Striboldt said:
I'm trying to plot a chart where the category (x-axis) consists of values
witch can be the same. The data I would like to show could for instance
look
like this:

x = "12:42:00", "12:42:00", "12:43:00", "12:43:00"
y = 4, 5, 6, 4

How do I plot this, so that all values are shown ?

Best regards,
Morten
 
A

Alvin Bruney

If you already have the values in the correct time format, there is no need
to add a numberformat specifier. For instance, "12:00:00" will show as
entered. Or are you seeing something different?

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

Striboldt said:
I tried to use the numberformat, but gets this error:
Invalid Parameter at OWC11.ChAxis.set_NumberFormat(String
pbstrNumberFormat)

This is my code:
strCategory = new System.Text.StringBuilder();
strCategory.Append("13:00:00" + '\t');
strCategory.Append("13:00:00" + '\t');
strCategory.Append("14:00:00" + '\t');
strCategory.Append("14:00:00" + '\t');

strValues = new System.Text.StringBuilder();
strValues.Append("1" + '\t');
strValues.Append("2" + '\t');
strValues.Append("3" + '\t');
strValues.Append("1" + '\t');

OWC11.ChartSpaceClass ChartSpace = new ChartSpaceClass();
ChartSpace.Charts.Add(0);
ChartSpace.Charts[0].SeriesCollection.Add(0);
ChartSpace.Charts[0].Type = ChartChartTypeEnum.chChartTypeColumnClustered;

ChartSpace.Charts[0].Axes[0].Scaling.Minimum = 0;
ChartSpace.Charts[0].Axes[0].Scaling.Maximum = 50;
ChartSpace.Charts[0].Axes[0].HasTickLabels = true;

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimSeriesNames,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "Uncorrectables");

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimCategories,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral,
strCategory.ToString());

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimValues,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral,
strValues.ToString());

ChartSpace.Charts[0].Axes[ChartAxisTypeEnum.chCategoryAxis].NumberFormat =
"##:##:##";

Can you figure out what i'm doing wrong ?

Best regards,
Morten
Alvin Bruney said:
Probably the simplest way forward involves using a format mask on the
numberformat property of the axis in question. Ex:
..numberformat = "##:##:##" or one of the appriate format specifiers
instead
of the format mask

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

Striboldt said:
I'm trying to plot a chart where the category (x-axis) consists of
values
witch can be the same. The data I would like to show could for instance
look
like this:

x = "12:42:00", "12:42:00", "12:43:00", "12:43:00"
y = 4, 5, 6, 4

How do I plot this, so that all values are shown ?

Best regards,
Morten
 
S

Striboldt

The problem is that I have multiple categories with the same values, but only
the first one is plotted.

So with the below data I'll only see "13:00:00" and "14:00:00" plotted once
with values of y = 1 and 3.

Alvin Bruney said:
If you already have the values in the correct time format, there is no need
to add a numberformat specifier. For instance, "12:00:00" will show as
entered. Or are you seeing something different?

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

Striboldt said:
I tried to use the numberformat, but gets this error:
Invalid Parameter at OWC11.ChAxis.set_NumberFormat(String
pbstrNumberFormat)

This is my code:
strCategory = new System.Text.StringBuilder();
strCategory.Append("13:00:00" + '\t');
strCategory.Append("13:00:00" + '\t');
strCategory.Append("14:00:00" + '\t');
strCategory.Append("14:00:00" + '\t');

strValues = new System.Text.StringBuilder();
strValues.Append("1" + '\t');
strValues.Append("2" + '\t');
strValues.Append("3" + '\t');
strValues.Append("1" + '\t');

OWC11.ChartSpaceClass ChartSpace = new ChartSpaceClass();
ChartSpace.Charts.Add(0);
ChartSpace.Charts[0].SeriesCollection.Add(0);
ChartSpace.Charts[0].Type = ChartChartTypeEnum.chChartTypeColumnClustered;

ChartSpace.Charts[0].Axes[0].Scaling.Minimum = 0;
ChartSpace.Charts[0].Axes[0].Scaling.Maximum = 50;
ChartSpace.Charts[0].Axes[0].HasTickLabels = true;

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimSeriesNames,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "Uncorrectables");

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimCategories,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral,
strCategory.ToString());

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimValues,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral,
strValues.ToString());

ChartSpace.Charts[0].Axes[ChartAxisTypeEnum.chCategoryAxis].NumberFormat =
"##:##:##";

Can you figure out what i'm doing wrong ?

Best regards,
Morten
Alvin Bruney said:
Probably the simplest way forward involves using a format mask on the
numberformat property of the axis in question. Ex:
..numberformat = "##:##:##" or one of the appriate format specifiers
instead
of the format mask

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

I'm trying to plot a chart where the category (x-axis) consists of
values
witch can be the same. The data I would like to show could for instance
look
like this:

x = "12:42:00", "12:42:00", "12:43:00", "12:43:00"
y = 4, 5, 6, 4

How do I plot this, so that all values are shown ?

Best regards,
Morten
 
A

Alvin Bruney

I get the same results. I have no idea why this is happening.

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

Striboldt said:
The problem is that I have multiple categories with the same values, but
only
the first one is plotted.

So with the below data I'll only see "13:00:00" and "14:00:00" plotted
once
with values of y = 1 and 3.

Alvin Bruney said:
If you already have the values in the correct time format, there is no
need
to add a numberformat specifier. For instance, "12:00:00" will show as
entered. Or are you seeing something different?

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

Striboldt said:
I tried to use the numberformat, but gets this error:
Invalid Parameter at OWC11.ChAxis.set_NumberFormat(String
pbstrNumberFormat)

This is my code:
strCategory = new System.Text.StringBuilder();
strCategory.Append("13:00:00" + '\t');
strCategory.Append("13:00:00" + '\t');
strCategory.Append("14:00:00" + '\t');
strCategory.Append("14:00:00" + '\t');

strValues = new System.Text.StringBuilder();
strValues.Append("1" + '\t');
strValues.Append("2" + '\t');
strValues.Append("3" + '\t');
strValues.Append("1" + '\t');

OWC11.ChartSpaceClass ChartSpace = new ChartSpaceClass();
ChartSpace.Charts.Add(0);
ChartSpace.Charts[0].SeriesCollection.Add(0);
ChartSpace.Charts[0].Type =
ChartChartTypeEnum.chChartTypeColumnClustered;

ChartSpace.Charts[0].Axes[0].Scaling.Minimum = 0;
ChartSpace.Charts[0].Axes[0].Scaling.Maximum = 50;
ChartSpace.Charts[0].Axes[0].HasTickLabels = true;

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimSeriesNames,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral,
"Uncorrectables");

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimCategories,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral,
strCategory.ToString());

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimValues,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral,
strValues.ToString());

ChartSpace.Charts[0].Axes[ChartAxisTypeEnum.chCategoryAxis].NumberFormat
=
"##:##:##";

Can you figure out what i'm doing wrong ?

Best regards,
Morten
:

Probably the simplest way forward involves using a format mask on the
numberformat property of the axis in question. Ex:
..numberformat = "##:##:##" or one of the appriate format specifiers
instead
of the format mask

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

I'm trying to plot a chart where the category (x-axis) consists of
values
witch can be the same. The data I would like to show could for
instance
look
like this:

x = "12:42:00", "12:42:00", "12:43:00", "12:43:00"
y = 4, 5, 6, 4

How do I plot this, so that all values are shown ?

Best regards,
Morten
 
S

Scott Ewald

Try:

..GroupingType = OWC11.ChartAxisGroupingEnum.chAxisGroupingNone

I get the same results. I have no idea why this is happening.

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

Striboldt said:
The problem is that I have multiple categories with the same values, but
only
the first one is plotted.

So with the below data I'll only see "13:00:00" and "14:00:00" plotted
once
with values of y = 1 and 3.

Alvin Bruney said:
If you already have the values in the correct time format, there is no
need
to add a numberformat specifier. For instance, "12:00:00" will show as
entered. Or are you seeing something different?

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

I tried to use the numberformat, but gets this error:
Invalid Parameter at OWC11.ChAxis.set_NumberFormat(String
pbstrNumberFormat)

This is my code:
strCategory = new System.Text.StringBuilder();
strCategory.Append("13:00:00" + '\t');
strCategory.Append("13:00:00" + '\t');
strCategory.Append("14:00:00" + '\t');
strCategory.Append("14:00:00" + '\t');

strValues = new System.Text.StringBuilder();
strValues.Append("1" + '\t');
strValues.Append("2" + '\t');
strValues.Append("3" + '\t');
strValues.Append("1" + '\t');

OWC11.ChartSpaceClass ChartSpace = new ChartSpaceClass();
ChartSpace.Charts.Add(0);
ChartSpace.Charts[0].SeriesCollection.Add(0);
ChartSpace.Charts[0].Type =
ChartChartTypeEnum.chChartTypeColumnClustered;

ChartSpace.Charts[0].Axes[0].Scaling.Minimum = 0;
ChartSpace.Charts[0].Axes[0].Scaling.Maximum = 50;
ChartSpace.Charts[0].Axes[0].HasTickLabels = true;

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimSeriesNames,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral,
"Uncorrectables");

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimCategories,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral,
strCategory.ToString());

ChartSpace.Charts[0].SeriesCollection[0].SetData(OWC11.ChartDimensionsEnum.chDimValues,
(int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral,
strValues.ToString());

ChartSpace.Charts[0].Axes[ChartAxisTypeEnum.chCategoryAxis].NumberFormat
=
"##:##:##";

Can you figure out what i'm doing wrong ?

Best regards,
Morten
:

Probably the simplest way forward involves using a format mask on the
numberformat property of the axis in question. Ex:
..numberformat = "##:##:##" or one of the appriate format specifiers
instead
of the format mask

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

I'm trying to plot a chart where the category (x-axis) consists of
values
witch can be the same. The data I would like to show could for
instance
look
like this:

x = "12:42:00", "12:42:00", "12:43:00", "12:43:00"
y = 4, 5, 6, 4

How do I plot this, so that all values are shown ?

Best regards,
Morten
 

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