scrolling clustered bar series slow

Posted by: ginacresse on 8 September 2017, 2:45 pm EST

  • Posted 8 September 2017, 2:45 pm EST

    I'm using the following code to build a clusterd bar chart.  The chart displays fine except that I cannot get the legend to show up.  Also, this chart is very slow to scroll up and down, unlike the non-clustered charts I've created.  Am I doing something wrong? <FONT size=2>


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Private</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub</FONT></FONT><FONT size=2> ChartEmptyVsNonEmpty(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> DS </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> Data.DataSet)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> series1 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> FarPoint.Win.Chart.BarSeries


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> series2 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> FarPoint.Win.Chart.BarSeries(series1)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> series </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> FarPoint.Win.Chart.ClusteredBarSeries()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> label </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> FarPoint.Win.Chart.LabelArea()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> model </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> FarPoint.Win.Chart.ChartModel()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> plotArea </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> FarPoint.Win.Chart.YPlotArea()

    </FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> ChartHeight </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Integer

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> legend </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> FarPoint.Win.Chart.LegendArea()


    legend.Location = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> PointF(0.98F, 0.5F)


    legend.AlignmentX = 1.0F


    legend.AlignmentY = 0.5F


    label.Text = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Empty / Non-Empty Tanks by Size Family"

    </FONT></FONT><FONT size=2>

    label.Location = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> PointF(0.5F, 0.02F)


    label.AlignmentX = 0.9F


    label.AlignmentY = 0.0F


    series1.Values.DataSource = DS.Tables(5)


    series1.Values.DataField = DS.Tables(5).Columns(1).ColumnName


    series1.CategoryNames.DataSource = DS.Tables(5)


    series1.CategoryNames.DataField = DS.Tables(5).Columns(0).ColumnName


    series1.LabelNumberFormat = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"#,##0"

    </FONT></FONT><FONT size=2>

    series1.LabelVisible = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>True

    </FONT></FONT><FONT size=2>

    series2.Values.DataSource = DS.Tables(5)


    series2.Values.DataField = DS.Tables(5).Columns(2).ColumnName


    series2.CategoryNames.DataSource = DS.Tables(5)


    series2.CategoryNames.DataField = DS.Tables(5).Columns(0).ColumnName


    series2.LabelNumberFormat = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"#,##0"

    </FONT></FONT><FONT size=2>

    series2.LabelVisible = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>True

    </FONT></FONT><FONT size=2>

    series.Series.Add(series1)


    series.Series.Add(series2)


    plotArea.Location = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> PointF(0.1, 0.05F) </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>

    </FONT></FONT><FONT size=2>

    plotArea.Size = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> SizeF(0.6F, 0.6F)


    plotArea.Series.Add(series)


    plotArea.Vertical = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT><FONT size=2>

    model.LabelAreas.Add(label)


    model.PlotAreas.Add(plotArea)


    fpsEmptyNonEmpty.ActiveSheet.ColumnHeader.Visible = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT><FONT size=2>

    fpsEmptyNonEmpty.ActiveSheet.RowHeader.Visible = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT><FONT size=2>

    fpsEmptyNonEmpty.ActiveSheet.PrintInfo.UseMax = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT><FONT size=2>

    ChartHeight = DS.Tables(5).Rows.Count * 50


    fpsEmptyNonEmpty_Sheet1_SpreadChart1.Size = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> Size(1000, ChartHeight)


    fpsEmptyNonEmpty_Sheet1_SpreadChart1.Model = model


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub</FONT></FONT>


    <FONT color=#0000ff size=2><FONT color=#0000ff size=2></FONT></FONT> 


    <FONT color=#0000ff size=2><FONT color=#0000ff size=2>I discovered I needed to add <FONT color=#000000 face="Courier New">model.LegendAreas.Add(legend)</FONT>
    but I the legend only consists of 2 colored boxes but no words.  How do I get the text to display?

    </FONT></FONT>
  • Replied 8 September 2017, 2:45 pm EST

    Hello,

    The above code working fine to show up the legend text. Please make sure that you have not changed the "TextFill" property for the legends anywhere. Also I have a clustered chart series which is as high as screen and I did not see any scrolling issue as well. I am using Spread 6 for Windows forms. 

    Could you please post a small sample application for us to debug?

     

    Thanks,

     

  • Replied 8 September 2017, 2:45 pm EST

    I discovered that the sluggishness while scrolling was caused by null values in my dataset, so I will address that with SQL. The missing text on the legend is still an issue as you can see in the attached project.
    2011/09/WindowsApplication1.zip
  • Replied 8 September 2017, 2:45 pm EST

    Hello,

    In your code you have not given any name to the series this is why legend shows no text for series name. I added following line of code and it worked fine.

    series1.SeriesName="series1"

    series2.SeriesName="series2"

     I hope it will help you.

     

    Thanks,

     

  • Replied 8 September 2017, 2:45 pm EST

    That was it! Thanks <img src="/emoticons/emotion-2.gif" alt="Big Smile" />
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels