0
votes

I am binding a TeeChart with a Bubble Series to a datasource. The datasource has very large values of data. Here is the dataset which I am binding my chart with.

Image 1 - Dataset Image

When I bind the chart with these values, no bubbles are plotted on the chart. An interesting thing to observe is that when I divide all these values with 100000 and then plot the chart, the bubbles do get plotted. One more point worth observing is that if I interchange the XValues and the YValues, then the chart does get plotted even with the original data. I want to plot the original values of the data and get the Radius values and the "Product_Desc" column in the tooltip.

Image 2 - Chart Image

Also how can the legend position be set so that it does not scroll to 2 lines.

Regards

Nupur Modi

2

2 Answers

1
votes

The problem seems to be in the scales. Note the Bubble series is thought to draw the Radius respecting the Axes scales.

Your XValues go from 239.560,5 to 5.776.576,87. This is a 5.537.016,37 range. And you have an X axis of 473 pixels length. So this means between each 2 X pixels there's an increment of 11.706,166.

Your YValues go from 67086938,62 to 63.500.3298,6. This is a 567.916.359,98 range. And you have an Y axis of 228 pixels length. So this means between each 2 Y pixels there's an increment of 2.490.861,228.

The radius you have go from 39.728.41 to 952.021,78.

These radius are bigger than the X pixel increment, so they are ok.

But these radius are smaller than the Y pixel increment, so in few words these bubbles have a too small radius for the Y axis range they are represented in.


I see two options for you:

  1. You can multiply your Radius values by 100 or more. This will result in wrong bubble sizes if you look at the axes scales. But maybe the important thing for you is to maintain a proportion between bubbles, not indicating a value in the axes through the radius.

  2. Change the series type for a 3D type. Since you have 3 values to represent, each one following quite a different scale, it may be more logic to use a 3D series type such as the Points3D. Ie:

        tChart1.Header.Visible = false;
    
        tChart1.Aspect.Chart3DPercent = 50;
        tChart1.Legend.Alignment = LegendAlignments.Top;
        tChart1.Legend.TextStyle = LegendTextStyles.Plain;
        tChart1.Axes.Depth.Visible = true;
        tChart1.Axes.Bottom.Title.Text = "XValues";
        tChart1.Axes.Left.Title.Text = "YValues";
        tChart1.Axes.Depth.Title.Text = "ZValues";
    
        Points3D points3D1 = new Points3D(tChart1.Chart);
        points3D1.ColorEach = true;
        points3D1.LinePen.Visible = false;
        points3D1.BaseLine.Visible = true;            
        points3D1.Add(544161.66, 114160840.39, 82491.58, "ComEd Commercial");
        points3D1.Add(239560.5, 67086938.62, 39728.41, "PECO Commercial");
        points3D1.Add(5776576.87, 635003298.6, 952021.78, "ComEd Residential");
        points3D1.Add(2657157.7, 552875694.07, 412903.38, "PECO Residential");
    

Points3D series

0
votes

Make sure the dot "." is your DecimalSeparator:

    System.Globalization.CultureInfo tmp_ci = (System.Globalization.CultureInfo)System.Globalization.CultureInfo.CurrentCulture.Clone();
    tmp_ci.NumberFormat.NumberDecimalSeparator = ".";
    System.Threading.Thread.CurrentThread.CurrentCulture = tmp_ci;

Maybe the "." is taken as NumberGroupSeparator and you are setting an axis scale out of the values range.