Dual axis Chart

M

Mike

I'm trying to make a dual axis line chart in asp.net. I can make a chart add
a second axis but I would like series "3" to be gauged against the new axis.
The axis on the left is $$ and the one on the right is units. series 1 - 2
are in $$ and series 3 is in units.. Also how do I change the Axis to report
to a difrent scale.

I hope I'm asking the right questions

Sample code:

While objDR.Read

strTitle1 = objDR.GetName(1)

strTitle2 = objDR.GetName(2)

strTitle3 = objDR.GetName(3)

ReDim Preserve strDates(intCounter)

ReDim Preserve intINVWW(intCounter)

ReDim Preserve intIVCH(intCounter)

ReDim Preserve intIVAC(intCounter)

strDates(intCounter) = objDR.GetDateTime(0)

Response.Write(strDates(intCounter))

intINVWW(intCounter) = objDR.GetDecimal(1)

Response.Write(intINVWW(intCounter))

intIVCH(intCounter) = objDR.GetDecimal(2)

Response.Write(intIVCH(intCounter))

intIVAC(intCounter) = objDR.GetInt32(3)

Response.Write(intIVAC(intCounter))

intCounter = intCounter + 1

End While

objDR.Close()

objCnn.Close()

Dim oChart As New OWC10.ChartSpace

oChart.Border.Color = OWC10.ChartColorIndexEnum.chColorNone

With oChart

..Charts.Add()

..Charts(0).Type = OWC10.ChartChartTypeEnum.chChartTypeLineMarkers

'-1 'OWC10.ChartChartTypeEnum.chChartTypeLineMarkers

..Charts(0).SeriesCollection.Add()

..Charts(0).SeriesCollection(0).Caption = strTitle1

..Charts(0).SeriesCollection(0).SetData(OWC10.ChartDimensionsEnum.chDimCatego
ries, OWC10.ChartSpecialDataSourcesEnum.chDataLiteral, strDates)

..Charts(0).SeriesCollection(0).SetData(OWC10.ChartDimensionsEnum.chDimValues
, OWC10.ChartSpecialDataSourcesEnum.chDataLiteral, intINVWW)

..Charts(0).HasLegend = True

..Charts(0).HasTitle = False


..Charts(0).SeriesCollection.Add()

..Charts(0).SeriesCollection(1).Caption = strTitle2

..Charts(0).SeriesCollection(1).SetData(OWC10.ChartDimensionsEnum.chDimCatego
ries, OWC10.ChartSpecialDataSourcesEnum.chDataLiteral, strDates)

..Charts(0).SeriesCollection(1).SetData(OWC10.ChartDimensionsEnum.chDimValues
, OWC10.ChartSpecialDataSourcesEnum.chDataLiteral, intIVCH)

..Charts(0).HasLegend = True

..Charts(0).HasTitle = False

..Charts(0).Axes.Add(.Charts(0).Scalings(OWC10.ChartDimensionsEnum.chDimValue
s))

..Charts(0).Axes(1).Position() =
OWC10.ChartAxisPositionEnum.chAxisPositionRight

..Charts(0).SeriesCollection.Add()

..Charts(0).SeriesCollection(2).SetData(OWC10.ChartDimensionsEnum.chDimThetaV
alues, OWC10.ChartSpecialDataSourcesEnum.chDataLiteral, intIVAC)

..Charts(0).SeriesCollection(2).Caption = strTitle3

..Charts(0).SeriesCollection(2).SetData(OWC10.ChartDimensionsEnum.chDimCatego
ries, OWC10.ChartSpecialDataSourcesEnum.chDataLiteral, strDates)

..Charts(0).SeriesCollection(2).SetData(OWC10.ChartDimensionsEnum.chDimValues
, OWC10.ChartSpecialDataSourcesEnum.chDataLiteral, intIVAC)

'.Charts(0).SeriesCollection(2).

..Charts(0).HasLegend = True

..Charts(0).HasTitle = False


' .Charts(0).Axes(1).Type = OWC10.ChartAxisTypeEnum.chSeriesAxis

End With

Response.Expires = 0

Response.Buffer = True

Response.Clear()

Response.ContentType = "image/gif"

Response.BinaryWrite(oChart.GetPicture("gif", 500, 300))

Response.End()
 

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