This project is read-only.

Using several Y axis with different scale

Jul 11 at 8:53 AM
Hello,

I have to show several line graphs in one plot. As the the Y range values differs a lot i want to assign each line a specific y axis. I already found out that i can do this by using InjectionPlooter and assign the line graphs to them, but the scale of each plotter is the same.

I'm using an ObservableDataSource<Point> for my values.

My XAML-Code:
<d3:ChartPlotter x:Name="Plotter" Height="400" Grid.Row="3" Grid.ColumnSpan="6" Grid.Column="0" Visibility="{Binding IsCollapsed, ElementName=Root, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter=Inverted}">
                    <d3:InjectedPlotter Name="y2" Background="Aqua" Height="400">
                        <d3:VerticalAxis Placement="Left"/>
                        <d3:VerticalAxisTitle Content="y2" Placement="Left" />
                    </d3:InjectedPlotter>
                    <d3:InjectedPlotter Name="y3" Background="Aqua" Height="400">
                        <d3:VerticalAxis Placement="Left"/>
                        <d3:VerticalAxisTitle Content="y3" Placement="Left"/>
                    </d3:InjectedPlotter>
                    <d3:InjectedPlotter Name="y4" Background="Aqua" Height="400">
                        <d3:VerticalAxis Placement="Left"/>
                        <d3:VerticalAxisTitle Content="y4" Placement="Left"/>
                    </d3:InjectedPlotter>
                </d3:ChartPlotter>
My Code behind for one line graph added to the y2-plotter
var data = new ObservableDataSource<Point>();
                    for (int i = 0; i < xvalues.Count(); i++)
                    {
                        data.Collection.Add(new Point(Convert.ToDouble(wiSeries[i].Replace('.', ','), new CultureInfo("de-DE")) + xoffset, Convert.ToDouble(miSeries[i].Replace('.', ','), new CultureInfo("de-DE"))));
                    }

LineGraph line = new LineGraph(data);
                    line.Stroke = this.GetRandomColor();
                    line.SetBinding(VisibilityProperty, new Binding { Source = this, Path = new PropertyPath("MiWiVisibility") });
                    this.y2.Children.Add(line);
Unfortuantelly i can't add a picture to show the result.

I really hope someone can help me to scale the Y-Axis becose some of the line graphs are only show as horizontal line and not as graph over the whole height.

Greetings,
Caipigott