View Full Version : OWC and time axis?


Striboldt
05-15-2006, 08:58 AM
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

Alvin Bruney
05-15-2006, 02:02 PM
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" <Striboldt@discussions.microsoft.com> wrote in message
news:20FF1B46-8663-4334-892E-25B5F8380401@microsoft.com...
> 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

Striboldt
05-16-2006, 09:03 AM
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" wrote:

> 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" <Striboldt@discussions.microsoft.com> wrote in message
> news:20FF1B46-8663-4334-892E-25B5F8380401@microsoft.com...
> > 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
>
>
>

Alvin Bruney
05-16-2006, 02:20 PM
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" <Striboldt@discussions.microsoft.com> wrote in message
news:DE8DE67A-C454-458A-93FD-5EE8A71E4C4F@microsoft.com...
>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" wrote:
>
>> 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" <Striboldt@discussions.microsoft.com> wrote in message
>> news:20FF1B46-8663-4334-892E-25B5F8380401@microsoft.com...
>> > 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
>>
>>
>>

Striboldt
05-16-2006, 03:01 PM
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" wrote:

> 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" <Striboldt@discussions.microsoft.com> wrote in message
> news:DE8DE67A-C454-458A-93FD-5EE8A71E4C4F@microsoft.com...
> >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" wrote:
> >
> >> 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" <Striboldt@discussions.microsoft.com> wrote in message
> >> news:20FF1B46-8663-4334-892E-25B5F8380401@microsoft.com...
> >> > 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
> >>
> >>
> >>
>
>
>

Alvin Bruney
05-16-2006, 04:24 PM
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" <Striboldt@discussions.microsoft.com> wrote in message
news:20A2635D-4B38-4708-AF63-DDA079923066@microsoft.com...
> 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" wrote:
>
>> 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" <Striboldt@discussions.microsoft.com> wrote in message
>> news:DE8DE67A-C454-458A-93FD-5EE8A71E4C4F@microsoft.com...
>> >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" wrote:
>> >
>> >> 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" <Striboldt@discussions.microsoft.com> wrote in message
>> >> news:20FF1B46-8663-4334-892E-25B5F8380401@microsoft.com...
>> >> > 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
>> >>
>> >>
>> >>
>>
>>
>>

Scott Ewald
05-30-2006, 08:40 PM
Try:

..GroupingType = OWC11.ChartAxisGroupingEnum.chAxisGroupingNone

on your category axis.



"Alvin Bruney" wrote:

> 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" <Striboldt@discussions.microsoft.com> wrote in message
> news:20A2635D-4B38-4708-AF63-DDA079923066@microsoft.com...
> > 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" wrote:
> >
> >> 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" <Striboldt@discussions.microsoft.com> wrote in message
> >> news:DE8DE67A-C454-458A-93FD-5EE8A71E4C4F@microsoft.com...
> >> >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" wrote:
> >> >
> >> >> 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" <Striboldt@discussions.microsoft.com> wrote in message
> >> >> news:20FF1B46-8663-4334-892E-25B5F8380401@microsoft.com...
> >> >> > 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
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>