Line Chart plot points

K

Kyle

Hello, I have a line chart that I am populating with arrays of prices
(currency) and intergers representing hours of the day. There are 60 price
points for every hour of the day (one per minute). However my chart is only
plotting one price point for every hour point.

How can this be corrected? I have tried setting various properties for major
and minor points and seem to get nowhere.

Thank you in advance.
 
K

Kyle

Here is the code that generates my current spot charts. The only section
that is not present is where I populate the arrays (aX,aY) with the data
from a dataset.

<code>
Dim chConstants
'New ChartSpace
ChartSpace1 = New OWC.ChartSpace
chConstants = ChartSpace1.Constants

'New Chart in Space
Chart1 = ChartSpace1.Charts.Add(0)
Chart1_Series1 = Chart1.seriesCollection.Add(0)
Chart1_Series1.Type = chConstants.chChartTypeLine

'Populate the X and Y values from array:
Chart1_Series1.SetData(OWC.ChartDimensionsEnum.chDimCategories,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aY)
Chart1_Series1.SetData(OWC.ChartDimensionsEnum.chDimValues,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aX)

' Format ChartSpace Elements
ChartSpace1.Border.Weight = 0
ChartSpace1.Interior.Color = "lightGray"
With ChartSpace1.Charts(0)
.PlotArea.Interior.SetTextured(chConstants.chTextureParchment,
chConstants.chTile)
.Border.Weight = 0
End With
With ChartSpace1.Charts(0).Axes(0) 'Hour Axes
.MinorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.TickLabelSpacing = 4
End With
With ChartSpace1.Charts(0).Axes(1) 'Price Axes
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
End With
Response.BinaryWrite(ChartSpace1.GetPicture("gif", ImageWidth, ImageHeight))
Response.End()
</code>
 
A

Alvin Bruney [MVP]

your array data is suspect. it must return minutes not hours for it to plot
correctly. I suspect the array contains hours values
 
K

Kyle

You are correct, I am only selecting the hour that the tick occured, which
is every minute. I don't want to display the whole time that the tick
occured only the hour in which it occured. Is there some other way around
this? Can I set a min/max value for relative points?
If I use the Dataset to populate the SetData Method, will that change this
behaviour?

Thanks

Alvin Bruney said:
your array data is suspect. it must return minutes not hours for it to plot
correctly. I suspect the array contains hours values

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Kyle" <kyle> wrote in message news:[email protected]...
Here is the code that generates my current spot charts. The only section
that is not present is where I populate the arrays (aX,aY) with the data
from a dataset.

<code>
Dim chConstants
'New ChartSpace
ChartSpace1 = New OWC.ChartSpace
chConstants = ChartSpace1.Constants

'New Chart in Space
Chart1 = ChartSpace1.Charts.Add(0)
Chart1_Series1 = Chart1.seriesCollection.Add(0)
Chart1_Series1.Type = chConstants.chChartTypeLine

'Populate the X and Y values from array:
Chart1_Series1.SetData(OWC.ChartDimensionsEnum.chDimCategories,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aY)
Chart1_Series1.SetData(OWC.ChartDimensionsEnum.chDimValues,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aX)

' Format ChartSpace Elements
ChartSpace1.Border.Weight = 0
ChartSpace1.Interior.Color = "lightGray"
With ChartSpace1.Charts(0)
.PlotArea.Interior.SetTextured(chConstants.chTextureParchment,
chConstants.chTile)
.Border.Weight = 0
End With
With ChartSpace1.Charts(0).Axes(0) 'Hour Axes
.MinorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.TickLabelSpacing = 4
End With
With ChartSpace1.Charts(0).Axes(1) 'Price Axes
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
End With
Response.BinaryWrite(ChartSpace1.GetPicture("gif", ImageWidth,
ImageHeight))
Response.End()
</code>
 
A

Alvin Bruney [MVP]

you need to use grouping to specify how many points in the interval you wish
to plot. Have a look at the groupingtype, gropuingunit and timescaling
functions

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Kyle said:
You are correct, I am only selecting the hour that the tick occured, which
is every minute. I don't want to display the whole time that the tick
occured only the hour in which it occured. Is there some other way around
this? Can I set a min/max value for relative points?
If I use the Dataset to populate the SetData Method, will that change this
behaviour?

Thanks

Alvin Bruney said:
your array data is suspect. it must return minutes not hours for it to plot
correctly. I suspect the array contains hours values

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Kyle" <kyle> wrote in message news:[email protected]...
Here is the code that generates my current spot charts. The only
section
that is not present is where I populate the arrays (aX,aY) with the
data
from a dataset.

<code>
Dim chConstants
'New ChartSpace
ChartSpace1 = New OWC.ChartSpace
chConstants = ChartSpace1.Constants

'New Chart in Space
Chart1 = ChartSpace1.Charts.Add(0)
Chart1_Series1 = Chart1.seriesCollection.Add(0)
Chart1_Series1.Type = chConstants.chChartTypeLine

'Populate the X and Y values from array:
Chart1_Series1.SetData(OWC.ChartDimensionsEnum.chDimCategories,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aY)
Chart1_Series1.SetData(OWC.ChartDimensionsEnum.chDimValues,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aX)

' Format ChartSpace Elements
ChartSpace1.Border.Weight = 0
ChartSpace1.Interior.Color = "lightGray"
With ChartSpace1.Charts(0)
.PlotArea.Interior.SetTextured(chConstants.chTextureParchment,
chConstants.chTile)
.Border.Weight = 0
End With
With ChartSpace1.Charts(0).Axes(0) 'Hour Axes
.MinorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.TickLabelSpacing = 4
End With
With ChartSpace1.Charts(0).Axes(1) 'Price Axes
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
End With
Response.BinaryWrite(ChartSpace1.GetPicture("gif", ImageWidth,
ImageHeight))
Response.End()
</code>


Try to post your code.
er.
 
K

Kyle

I thought of that, but the grouping is only by Date and not time. Can you
create a custom GroupUnitType? Given my scenario that I have outlined below,
can you give me some examples of how I might handle it??

Alvin Bruney said:
you need to use grouping to specify how many points in the interval you wish
to plot. Have a look at the groupingtype, gropuingunit and timescaling
functions

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Kyle said:
You are correct, I am only selecting the hour that the tick occured, which
is every minute. I don't want to display the whole time that the tick
occured only the hour in which it occured. Is there some other way around
this? Can I set a min/max value for relative points?
If I use the Dataset to populate the SetData Method, will that change this
behaviour?

Thanks

Alvin Bruney said:
your array data is suspect. it must return minutes not hours for it to plot
correctly. I suspect the array contains hours values

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Kyle" <kyle> wrote in message Here is the code that generates my current spot charts. The only
section
that is not present is where I populate the arrays (aX,aY) with the
data
from a dataset.

<code>
Dim chConstants
'New ChartSpace
ChartSpace1 = New OWC.ChartSpace
chConstants = ChartSpace1.Constants

'New Chart in Space
Chart1 = ChartSpace1.Charts.Add(0)
Chart1_Series1 = Chart1.seriesCollection.Add(0)
Chart1_Series1.Type = chConstants.chChartTypeLine

'Populate the X and Y values from array:
Chart1_Series1.SetData(OWC.ChartDimensionsEnum.chDimCategories,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aY)
Chart1_Series1.SetData(OWC.ChartDimensionsEnum.chDimValues,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aX)

' Format ChartSpace Elements
ChartSpace1.Border.Weight = 0
ChartSpace1.Interior.Color = "lightGray"
With ChartSpace1.Charts(0)
.PlotArea.Interior.SetTextured(chConstants.chTextureParchment,
chConstants.chTile)
.Border.Weight = 0
End With
With ChartSpace1.Charts(0).Axes(0) 'Hour Axes
.MinorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.TickLabelSpacing = 4
End With
With ChartSpace1.Charts(0).Axes(1) 'Price Axes
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
End With
Response.BinaryWrite(ChartSpace1.GetPicture("gif", ImageWidth,
ImageHeight))
Response.End()
</code>


Try to post your code.
er.
 
A

Alvin Bruney [MVP]

Date granularity is the lowest you can go. It's not possible to group by an
hour. The only thing i can think of is that you will need to customize the
x-axis with custom drawing. Basically, you will need to enable events and
then trap each point as it is being plotted, determine if it is a point
which needs to be plotted and either plot or discard it. You will need to
use the chPoint object for this. It's definitely a lot of pain but it is all
i can think of at the moment.

Maybe someone has an easier alternative or a better solution.

A last resort is to open up a ticket with microsoft product support. They
may be able to get you what you want.
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Kyle said:
I thought of that, but the grouping is only by Date and not time. Can you
create a custom GroupUnitType? Given my scenario that I have outlined
below,
can you give me some examples of how I might handle it??

Alvin Bruney said:
you need to use grouping to specify how many points in the interval you wish
to plot. Have a look at the groupingtype, gropuingunit and timescaling
functions

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Kyle said:
You are correct, I am only selecting the hour that the tick occured, which
is every minute. I don't want to display the whole time that the tick
occured only the hour in which it occured. Is there some other way around
this? Can I set a min/max value for relative points?
If I use the Dataset to populate the SetData Method, will that change this
behaviour?

Thanks

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
your array data is suspect. it must return minutes not hours for it to
plot
correctly. I suspect the array contains hours values

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Kyle" <kyle> wrote in message
Here is the code that generates my current spot charts. The only
section
that is not present is where I populate the arrays (aX,aY) with the
data
from a dataset.

<code>
Dim chConstants
'New ChartSpace
ChartSpace1 = New OWC.ChartSpace
chConstants = ChartSpace1.Constants

'New Chart in Space
Chart1 = ChartSpace1.Charts.Add(0)
Chart1_Series1 = Chart1.seriesCollection.Add(0)
Chart1_Series1.Type = chConstants.chChartTypeLine

'Populate the X and Y values from array:
Chart1_Series1.SetData(OWC.ChartDimensionsEnum.chDimCategories,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aY)
Chart1_Series1.SetData(OWC.ChartDimensionsEnum.chDimValues,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aX)

' Format ChartSpace Elements
ChartSpace1.Border.Weight = 0
ChartSpace1.Interior.Color = "lightGray"
With ChartSpace1.Charts(0)
.PlotArea.Interior.SetTextured(chConstants.chTextureParchment,
chConstants.chTile)
.Border.Weight = 0
End With
With ChartSpace1.Charts(0).Axes(0) 'Hour Axes
.MinorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.TickLabelSpacing = 4
End With
With ChartSpace1.Charts(0).Axes(1) 'Price Axes
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
End With
Response.BinaryWrite(ChartSpace1.GetPicture("gif", ImageWidth,
ImageHeight))
Response.End()
</code>


Try to post your code.
er.
 
G

Gary Heaven

Hmm.. Hours worked for me but it is very obscure.
The trick is to leave a "Seconds" group as well. It is a
little ugly but works..
Plot two groups - in your case Hours and Seconds
Set the minor tick mark spacing to a big value to hide all
but the first tick mark label. (i.e. for a month set it to
31*24*60)
Enable the groups via the internal pivot table of the
chart viz...
<CodeSnip>
.PlotAllAggregates = c.chPlotAggregatesSeries
.SetData c.chDimCategories, c.chDataBound, Array
("PeriodStart by Month")
Set theView = CS1.InternalPivotTable.ActiveView
Set theFieldSet = theView.FieldSets.Item
("PeriodStart by Month")
For each theField in theFieldSet.Fields
theField.IsIncluded=False
next
theFieldSet.Fields("Hours").IsIncluded =
True
theFieldSet.Fields("Seconds").IsIncluded =
True
-----Original Message-----
Date granularity is the lowest you can go. It's not possible to group by an
hour. The only thing i can think of is that you will need to customize the
x-axis with custom drawing. Basically, you will need to enable events and
then trap each point as it is being plotted, determine if it is a point
which needs to be plotted and either plot or discard it. You will need to
use the chPoint object for this. It's definitely a lot of pain but it is all
i can think of at the moment.

Maybe someone has an easier alternative or a better solution.

A last resort is to open up a ticket with microsoft product support. They
may be able to get you what you want.
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Kyle said:
I thought of that, but the grouping is only by Date and not time. Can you
create a custom GroupUnitType? Given my scenario that I have outlined
below,
can you give me some examples of how I might handle it??

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
you need to use grouping to specify how many points in
the interval you
wish
to plot. Have a look at the groupingtype, gropuingunit and timescaling
functions

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Kyle" <kyle> wrote in message
You are correct, I am only selecting the hour that
the tick occured,
which
is every minute. I don't want to display the whole time that the tick
occured only the hour in which it occured. Is there
some other way
around
this? Can I set a min/max value for relative points?
If I use the Dataset to populate the SetData Method,
will that change
this
behaviour?

Thanks

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
your array data is suspect. it must return minutes not hours for it to
plot
correctly. I suspect the array contains hours values

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Kyle" <kyle> wrote in message
Here is the code that generates my current spot charts. The only
section
that is not present is where I populate the arrays (aX,aY) with the
data
from a dataset.

<code>
Dim chConstants
'New ChartSpace
ChartSpace1 = New OWC.ChartSpace
chConstants = ChartSpace1.Constants

'New Chart in Space
Chart1 = ChartSpace1.Charts.Add(0)
Chart1_Series1 = Chart1.seriesCollection.Add(0)
Chart1_Series1.Type = chConstants.chChartTypeLine

'Populate the X and Y values from array:
Chart1_Series1.SetData (OWC.ChartDimensionsEnum.chDimCategories,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aY)
Chart1_Series1.SetData (OWC.ChartDimensionsEnum.chDimValues,
OWC.ChartSpecialDataSourcesEnum.chDataLiteral, aX)

' Format ChartSpace Elements
ChartSpace1.Border.Weight = 0
ChartSpace1.Interior.Color = "lightGray"
With ChartSpace1.Charts(0)
.PlotArea.Interior.SetTextured (chConstants.chTextureParchment,
chConstants.chTile)
.Border.Weight = 0
End With
With ChartSpace1.Charts(0).Axes(0) 'Hour Axes
.MinorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.TickLabelSpacing = 4
End With
With ChartSpace1.Charts(0).Axes(1) 'Price Axes
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
.MajorTickMarks = OWC.ChartTickMarkEnum.chTickMarkInside
End With
Response.BinaryWrite(ChartSpace1.GetPicture ("gif", ImageWidth,
ImageHeight))
Response.End()
</code>


news:5F83DA1A-EB45-4F0B-8A5F- (e-mail address removed)...
Try to post your code.
er.


.
 

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