#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2005
    Posts
    58
    Rep Power
    10

    Vb 2010 StackedColoumchart


    can someone please tell me what i can do to fix this problem with a stackedcolumn chart in VB

    i need 3 series stacked to show total items for given delivery dates. series1 is items in production, series2 is items awaiting production and series 3 is items not yet transfered to our production software for production scheduling (series3 is a different database)

    series1 and series2 come from one datasource and stack correctly in the chart but series3 comes from a totally different datasource. Series3 data looks like it floating above the series1 and 2 stackedcolumn. It is the correct date colomn and value is correct but there is a gap before showing the series3 block.

    i dont know how to attach images on here but if u need to see then please post how i can display a jpg.

    Cheers

    my code is as follows

    Code:
            
    Dim mySelectQuery As String = "SOME SQL"
    Dim myConnection As New OdbcConnection(Conn1)
    Dim myCommand As New OdbcCommand(mySelectQuery, myConnection)
    
    myConnection.Open()
    
    Dim myReader As OdbcDataReader = myCommand.ExecuteReader()
    Chart1.Series("Series1").Points.DataBindXY(myReader, "deliverydate1", myReader, "BATCHED")
    myReader.Close()
    
    Dim myReader2 As OdbcDataReader = myCommand.ExecuteReader()
    Chart1.Series("Series2").Points.DataBindXY(myReader2, "deliverydate2", myReader2, "REMAINING")
    myReader2.Close()
    
    myConnection.Close()
    
    Dim mySelectQuery3 As String = "SOME SQL"
    Dim myConnection3 As New OdbcConnection(Conn2)
    Dim myCommand3 As New OdbcCommand(mySelectQuery3, myConnection3)
    
            myConnection3.Open()
            Dim myReader3 As OdbcDataReader = myCommand3.ExecuteReader()
            Chart1.Series("Series3").Points.DataBindXY(myReader3, "deliverydate3", myReader3, "TOTAL")
            myReader3.Close()
    
            myConnection3.Close()
    
            Chart1.Series("Series1").ChartType = SeriesChartType.StackedColumn
            Chart1.Series("Series2").ChartType = SeriesChartType.StackedColumn
            Chart1.Series("Series3").ChartType = SeriesChartType.StackedColumn
    
            Chart1.Series("Series1").IsValueShownAsLabel = True
            Chart1.Series("Series2").IsValueShownAsLabel = True
            Chart1.Series("Series3").IsValueShownAsLabel = True
    
            Chart1.Series("Series1").XValueType = DataVisualization.Charting.ChartValueType.Date
            Chart1.Series("Series2").XValueType = DataVisualization.Charting.ChartValueType.Date
            Chart1.Series("Series3").XValueType = DataVisualization.Charting.ChartValueType.Date
    
            Chart1.ChartAreas("ChartArea1").Area3DStyle.Enable3D = True
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2005
    Posts
    58
    Rep Power
    10
    not sure if useful but this is the xml exported from the results of the chart

    Code:
    <Chart Palette="Bright" IsSoftShadows="False" Size="1214, 638">
      <Series>
        <Series Name="Series1" Legend="Legend1" XValueType="Date" YValueType="Double" ChartType="StackedColumn" ChartArea="ChartArea1" IsValueShownAsLabel="True" Color="Red" Font="Microsoft Sans Serif, 9.75pt, style=Bold, GdiCharSet=0" LabelForeColor="White">
          <Points>
            <DataPoint XValue="40959" YValues="557" />
            <DataPoint XValue="40960" YValues="360" />
            <DataPoint XValue="40961" YValues="348" />
            <DataPoint XValue="40962" YValues="189" />
            <DataPoint XValue="40963" YValues="604" />
            <DataPoint XValue="40966" YValues="289" />
            <DataPoint XValue="40967" YValues="428" />
            <DataPoint XValue="40968" YValues="105" />
            <DataPoint XValue="40969" YValues="75" />
            <DataPoint XValue="40970" YValues="90" />
            <DataPoint XValue="40973" YValues="127" />
            <DataPoint XValue="40974" YValues="116" />
            <DataPoint XValue="40975" YValues="105" />
            <DataPoint XValue="40976" YValues="115" />
          </Points>
        </Series>
        <Series Name="Series2" Legend="Legend1" XValueType="Date" YValueType="Int32" ChartType="StackedColumn" ChartArea="ChartArea1" IsValueShownAsLabel="True" Color="PowderBlue" Font="Microsoft Sans Serif, 9.75pt, style=Bold, GdiCharSet=0" LabelForeColor="White">
          <Points>
            <DataPoint XValue="40959" YValues="0" />
            <DataPoint XValue="40960" YValues="0" />
            <DataPoint XValue="40961" YValues="0" />
            <DataPoint XValue="40962" YValues="0" />
            <DataPoint XValue="40963" YValues="0" />
            <DataPoint XValue="40966" YValues="55" />
            <DataPoint XValue="40967" YValues="34" />
            <DataPoint XValue="40968" YValues="26" />
            <DataPoint XValue="40969" YValues="17" />
            <DataPoint XValue="40970" YValues="72" />
            <DataPoint XValue="40973" YValues="9" />
            <DataPoint XValue="40974" YValues="27" />
            <DataPoint XValue="40975" YValues="18" />
            <DataPoint XValue="40976" YValues="5" />
          </Points>
        </Series>
        <Series Name="Series3" Legend="Legend1" XValueType="Date" YValueType="Int32" ChartType="StackedColumn" ChartArea="ChartArea1" IsValueShownAsLabel="True" Font="Microsoft Sans Serif, 9.75pt, style=Bold" LabelForeColor="White">
          <Points>
            <DataPoint XValue="40967" YValues="8" />
            <DataPoint XValue="40973" YValues="2" />
          </Points>
        </Series>
      </Series>
      <Legends>
        <Legend Name="Legend1" Enabled="False" LegendStyle="Column" BackImageAlignment="Bottom">
        </Legend>
      </Legends>
      <ChartAreas>
        <ChartArea Name="ChartArea1">
          <AxisX LabelAutoFitMinFontSize="10" Interval="1">
          </AxisX>
          <Area3DStyle Enable3D="True" IsClustered="True" />
        </ChartArea>
      </ChartAreas>
    </Chart>

IMN logo majestic logo threadwatch logo seochat tools logo