Plot Strings on the X-Axis

Charts for WPF Forum

Posted 9 years ago by Dave
Version: 14.2.0610
Avatar

Hello,

I am having a simple chart with some datapoints:

<charts:XYChart x:Name="diagram" GridLineMajorVisibility="Y" Height="340" Width="640" Padding="20" IsEnabled="True">
<charts:XYChart.YAxes >
<charts:XYDoubleAxis x:Name="Y"
Minimum ="0"
AreMajorTicksVisible="True"
AreMinorTicksVisible="false"
AreLabelsVisible="True"
TickMajorInterval="1" TickMinorInterval="0.25">
<charts:XYDoubleAxis.Ranges>
<charts:XYRange x:Name="test0" Minimum="0.5" Maximum="10" Background="#33D3D3D3" />
<charts:XYRange x:Name="test1" Minimum="0.25" Maximum="0.5" Background="#33808080" />
<charts:XYRange x:Name="test2" Minimum="-0.1" Maximum="0.25" Background="#33000000"/>
</charts:XYDoubleAxis.Ranges>
</charts:XYDoubleAxis>
</charts:XYChart.YAxes>

<charts:XYChart.XAxes >
<charts:XYDoubleAxis x:Name="X"
Minimum="0"
Maximum="1"
AreLabelsVisible="false"
AreMajorTicksVisible="false"
AreMinorTicksVisible="false" >

</charts:XYDoubleAxis>
</charts:XYChart.XAxes>

<charts:ScatterSeries ItemsSource="{Binding Path=ChartObjects}"
YPath="value"
XPath="name"
LabelVisibility="PointerProximity"
LabelFormat="{}{0:0.00}">

</charts:ScatterSeries>
</charts:XYChart>

 

I will get following Error:

1.Error type:

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='ActiproSoftware.Windows.Controls.Navigation.ZoomDecorator', AncestorLevel='1''. BindingExpression:Path=ZoomLevelAnimated; DataItem=null; target element is 'ScaleTransform' (HashCode=43616934); target property is 'ScaleX' (type 'Double')

Is it because i am using strings to plot on the x-Axis instead of numeric values?

Is this error the reason why i cannot hide the labels and the ticks of the X-Axis?

Thanks

 

I am using Version 14.1.0602

[Modified 9 years ago]

Comments (3)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Dave,

The error there seems to be indicating a binding error within the containing zoom container control, not within the chart. 

That being said, if you are trying to put string X data into an XYDoubleAxis as you are, that could also be a problem.  If you wish to plot string data then you need to use an XYGroupedAxis instead.  Please check the Axes documentation topic for more information on that.

See if that helps fix the problem.  If not, please make a new simple sample project that shows the issue and email that to our support address.  Be sure to rename the .zip file extension so it doesn't get spam blocked.


Actipro Software Support

Posted 9 years ago by Dave
Avatar

Hi,

i fixed the problem.

thanks  

Posted 9 years ago by Justin Klein
Avatar

Could you post some info about how you fixed the issue?  I'm seeing this error too, in what seems to be the most simple example:

 

<navigation:ZoomContentControl>
    <shared:ActiproLogo />
</navigation:ZoomContentControl>

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.