【问题标题】:Max value of Secondary Axis Fusion Chart vb.net次轴融合图 vb.net 的最大值
【发布时间】:2015-01-15 04:34:31
【问题描述】:

我有两个数据集。一个表示为 2D 100% 堆叠列,另一个表示为线。 二维柱在主要 Y 轴上,折线图在次要 Y 轴上。主 Y 轴和辅助 Y 轴最大值不匹配。这导致折线图在不正确的位置与柱状图相反。

例如:柱形图的值是 [(60,40),(70,30)]。折线图的值为 [30,40]。所以这里的折线图看起来比柱状图高。

    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

我想要做的就是使辅助 Y 轴最大值为 100 或定义辅助轴的间隔。使两个 Y 轴相互同步。

【问题讨论】:

    标签: vb.net graph charts


    【解决方案1】:

    添加以下语法有帮助。并施展了魔法。

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

    全图起始线

    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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多