0
votes

I have two data sets. One is represented as 2D 100% stcked column and another is represented as line. 2D column is on primary Y-axis & line chart is on secondary Y-axis. The primary Y-axis and secondary Y-axis max value doesn't match. Which causes the line graph at improper position wrt to column graph.

Eg: The Column graph has values [(60,40),(70,30)]. the line graph has values [30,40]. So Here the line graph appears higher than the column graphs.

    Sub createWeeklyGraph_stack()
    'Create an XML data document in a string variable

    Dim strXML As String = ""
    strXML = strXML & "<chart caption='Weekly Order Booking Efficiency' xaxisName='YearMonths' pyaxisname='Orders booked in percentage' syaxisname='I2 Confirmed without Amendment' showplotborder='1' palette='2' showborder='0'>"

    For i As Integer = 0 To ds_week.Rows.Count - 1
        Dim weekno1 As String = ds_week.Rows(i).Item(0).ToString()
        Dim mon1 As String = ds_week.Rows(i).Item(1).ToString()
        Dim Confirmedbyi21 As String = ds_week.Rows(i).Item(3).ToString()
        Dim Confirmedbypass1 As String = ds_week.Rows(i).Item(4).ToString()
        Dim Amended1 As String = ds_week.Rows(i).Item(5).ToString()
        Dim Amended_n1 As String = ds_week.Rows(i).Item(6).ToString()
    Next

    strXML = strXML & "<categories>"
    For i As Integer = 0 To ds_week.Rows.Count - 1
        strXML = strXML & "<category label='" & ds_week.Rows(i).Item(0).ToString & "'/>"
    Next
    strXML = strXML & "</categories>"

    strXML = strXML & "<dataset seriesName='I2' color='FFFF00'>"
    For i As Integer = 0 To ds_week.Rows.Count - 1
        strXML = strXML & "<set value= '" & ds_week.Rows(i).Item(3).ToString & "'/>"
    Next
    strXML = strXML & "</dataset>"

    strXML = strXML & "<dataset seriesName='Amend' color='FF0000'>"
    For i As Integer = 0 To ds_week.Rows.Count - 1
        strXML = strXML & "<set value= '" & ds_week.Rows(i).Item(5).ToString & "'/>"
    Next
    strXML = strXML & "</dataset>"

    strXML = strXML & "<dataset seriesName='Bypass' color='9ACCF6'>"
    For i As Integer = 0 To ds_week.Rows.Count - 1
        strXML = strXML & "<set value= '" & ds_week.Rows(i).Item(4).ToString & "'/>"
    Next
    strXML = strXML & "</dataset>"

    strXML = strXML & "<dataset seriesname='I2 Confirmed without Amendment' parentyaxis='S' linethickness='4' showvalues='0' renderas='Line' color='4B0082'>"
    For i As Integer = 0 To ds_week.Rows.Count - 1
        strXML = strXML & "<set value= '" & ds_week.Rows(i).Item(6).ToString & "'/>"
    Next

    strXML = strXML & "</dataset>"
    strXML = strXML & " <styles> "
    strXML = strXML & "<definition>"
    strXML = strXML & "<style type='font' name='CaptionFont' bold='1' color='666666' size='17' />"
    strXML = strXML & "<style type='font' name='SubCaptionFont' bold='1' />"
    strXML = strXML & "</definition>"
    strXML = strXML & "<application>"
    strXML = strXML & " <apply toObject='caption' styles='CaptionFont' />"
    strXML = strXML & " <apply toObject='SubCaption' styles='SubCaptionFont' />"
    strXML = strXML & "</application>"
    strXML = strXML & "</styles></chart>"

    'Create the chart - Stacked Column 3D Chart with data from strXML variable using dataXML method
    Dim str As String = FusionCharts.RenderChartHTML("FusionCharts1\StackedColumn3DLineDY.swf", "", strXML, "New1", "1200", "300", False)

    Literal1.Text = str
    Literal1.Visible = True
End Sub

All I want to do is that make secondary Y-axis max value 100 or define the intervals in secondary axis. So that both Y-axis are synced with each other.

1

1 Answers

0
votes

Adding following syntax helped. and did the magic.

 PYAxisMaxValue='110' SYAxisMaxValue='110' syncAxisLimits='1' 

Full Chart Starting Line

strXML = strXML & "<chart caption='Order Booking Efficiency' xaxisName='YearMonths' pyaxisname='Orders booked in percentage' syaxisname='Amendment NonSystem in percentage' PYAxisMaxValue='110' SYAxisMaxValue='110' syncAxisLimits='1' showplotborder='1' palette='2' showborder='0' >"

Reference to the document