Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to pragmatically create BubbleSeries in SL4
    primarykey
    data
    text
    <p>I am creating a <em>BubbleSeries</em> in a function within <em>CS</em> file. As a data source I use a <code>List&lt;Dictionary&lt;string,string&gt;&gt; GridData</code>, Unfortunately my implementation throws an exception: <code>No suitable axis is available for plotting the dependent value.</code> I am SL4 newbie and I can not figure out what could be a reson. Here is how I create and add <em>BubbleSeries</em> to <em>Chart</em>:</p> <pre><code> List&lt;Dictionary&lt;string,string&gt;&gt; GridData = getGridData(); var s1 = new BubbleSeries(); s1.DependentValueBinding = new Binding("[" + &lt;key to numeric value in DataGrid&gt; + "]"); s1.SizeValueBinding = new Binding("[" + &lt;key to numeric value in DataGrid&gt; + "]"); s1.IndependentValueBinding = new Binding("[" + &lt;key to string value in DataGrid&gt; + "]"); s1.ItemsSource = GridData; s1.Title = "Chart"; // add BubbleSeries to Chart ChartVis.Series.Add(s1); </code></pre> <p>Here is a full description of an error I got in runtime:</p> <pre><code>Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E) Timestamp: Mon, 20 Sep 2010 07:09:33 UTC Message: Unhandled Error in Silverlight Application Code: 4004 Category: ManagedRuntimeError Message: System.InvalidOperationException: No suitable axis is available for plotting the dependent value. at System.Windows.Controls.DataVisualization.Charting.BubbleSeries.&lt;&gt;c__DisplayClass6.&lt;GetAxes&gt;b__3() at System.Windows.Controls.DataVisualization.Charting.DataPointSeriesWithAxes.GetAxes(DataPoint firstDataPoint, Func`2 independentAxisPredicate, Func`1 independentAxisFactory, Func`2 dependentAxisPredicate, Func`1 dependentAxisFactory) at System.Windows.Controls.DataVisualization.Charting.BubbleSeries.GetAxes(DataPoint firstDataPoint) at System.Windows.Controls.DataVisualization.Charting.DataPointSeriesWithAxes.GetAxes() at System.Windows.Controls.DataVisualization.Charting.DataPointSeriesWithAxes.OnDataPointsChanged(IList`1 newDataPoints, IList`1 oldDataPoints) at System.Windows.Controls.DataVisualization.Charting.DataPointSingleSeriesWithAxes.OnDataPointsChanged(IList`1 newDataPoints, IList`1 oldDataPoints) at System.Windows.Controls.DataVisualization.Charting.DataPointSeries.LoadDataPoints(IEnumerable newItems, IEnumerable oldItems) at System.Windows.Controls.DataVisualization.Charting.DataPointSeries.Refresh() at System.Windows.Controls.DataVisualization.Charting.DataPointSeries.OnSizeChanged(Object sender, SizeChangedEventArgs e) at System.Windows.FrameworkElement.OnSizeChanged(Object sender, SizeChangedEventArgs e) at MS.Internal.JoltHelper.RaiseEvent(IntPtr target, UInt32 eventId, IntPtr coreEventArgs, UInt32 eventArgsTypeIndex) Line: 56 Char: 13 Code: 0 URI: http://localhost:49402/MyTestPage.aspx </code></pre> <p>My chart implementation is:</p> <pre><code> &lt;toolkit:Chart Title="Visaulization" Grid.Column="0" x:Name="ChartVis"&gt; &lt;toolkit:Chart.Series&gt; &lt;/toolkit:Chart.Series&gt; &lt;/toolkit:Chart&gt; </code></pre> <p><strong>UPDATE:</strong> After changing the declaration of my dictionary to <code>Dictionary&lt;string,object&gt;</code>, and putting numeric values as doubles. I got this error:</p> <pre><code>Message: Unhandled Error in Silverlight Application Code: 4004 Category: ManagedRuntimeError Message: System.InvalidOperationException: Assigned dependent axis cannot be used. This may be due to an unset Orientation property for the axis or a type mismatch between the values being plotted and those supported by the axis. at System.Windows.Controls.DataVisualization.Charting.DataPointSeriesWithAxes.GetAxes(DataPoint firstDataPoint, Func`2 independentAxisPredicate, Func`1 independentAxisFactory, Func`2 dependentAxisPredicate, Func`1 dependentAxisFactory) at System.Windows.Controls.DataVisualization.Charting.BubbleSeries.GetAxes(DataPoint firstDataPoint) at System.Windows.Controls.DataVisualization.Charting.DataPointSeriesWithAxes.GetAxes() at System.Windows.Controls.DataVisualization.Charting.DataPointSeriesWithAxes.OnDataPointsChanged(IList`1 newDataPoints, IList`1 oldDataPoints) at System.Windows.Controls.DataVisualization.Charting.DataPointSingleSeriesWithAxes.OnDataPointsChanged(IList`1 newDataPoints, IList`1 oldDataPoints) at System.Windows.Controls.DataVisualization.Charting.DataPointSeries.LoadDataPoints(IEnumerable newItems, IEnumerable oldItems) at System.Windows.Controls.DataVisualization.Charting.DataPointSeries.Refresh() at System.Windows.Controls.DataVisualization.Charting.DataPointSeries.OnSizeChanged(Object sender, SizeChangedEventArgs e) at System.Windows.FrameworkElement.OnSizeChanged(Object sender, SizeChangedEventArgs e) at MS.Internal.JoltHelper.RaiseEvent(IntPtr target, UInt32 eventId, IntPtr coreEventArgs, UInt32 eventArgsTypeIndex) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload