views:

325

answers:

4

I have a bubble chart in a WPF application with LOTS of points in a BubbleSeries. The automatically drawn sizes of the bubbles result in so much overlap of the plotted bubbles, that most of the bubble points are obscured. The drawn bubble size does not change if I alter the data reduce the SizeValues of all the plotted points (some sort of hidden logic seems to be determining how to automatically scale the SizeValues when drawing the bubbles).

How can I reduce the diameter of every bubble by 75% (so each bubble's diameter is one fourth the normal automatic size)?

Thanks, Alan

[I am working with the charting/data visulaization controls in the June 2009 WPF control toolkit, but I think the same question and answer probably applies to Silverlight 3 bubble charts.]

A: 

If I understand the question correctly, you want to be able to scale your content without actually having to redraw it, correct? If so, you should have a look at the Viewbox class.

Drew Marsh
A: 

Not sure if there's something like this in WPF toolkit charts but in amCharts for WPF there are MinBulletSize/MaxBulletSize properties to control scaling of the bubbles. I think there must be something along these lines in WPF/Silverlight toolkit charts too.

Alan Mendelevich
A: 

Creating the Style:

    <Style x:Key="BubbleDataPointStyle" TargetType="chartingToolkit:BubbleDataPoint">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="chartingToolkit:BubbleDataPoint">
                    <Grid RenderTransformOrigin=".5,.5">
                        <Grid.RenderTransform>
                            <ScaleTransform ScaleX=".25" ScaleY=".25" />
                        </Grid.RenderTransform>
                        <controlsToolkit:Viewbox x:Name="viewbox">
                            <Ellipse Width="1" Height="1" />
                        </controlsToolkit:Viewbox>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

Add the Style to your data points:

    <chartingToolkit:Chart>
        <chartingToolkit:Chart.Series>
            <chartingToolkit:BubbleSeries
                ItemsSource="{Binding ObjectCollection}"
                IndependentValuePath="AxisX"
                DependentValuePath="AxisY"
                SizeValuePath="Size"
                DataPointStyle="{StaticResource BubbleDataPointStyle}" />
        </chartingToolkit:Chart.Series>
    </chartingToolkit:Chart>
TwistedStem
A: 

Thanq very much and its working and made my job easier

Samba