Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

X and Y Axis Border are not appearing even though I set the Axis Thickness to 5 #142

Closed
Billy-Joel opened this issue May 1, 2016 · 8 comments

Comments

@Billy-Joel
Copy link

Hi Beto,

Good day, first of all I want to thank you for this wonderful chart control. This really helps me a lot.

I'm working on a simple line chart with X and Y values. I've been trying to set the thickness of the X and Y borders to have a line at the beginning of the minimum value but have no luck in doing so.
Here is my code....

LiveCharts:LineChart.AxisX

                                                                                        <LiveCharts:Axis FontSize="3" Title="X" Color="Gray" StrokeThickness="5" IsEnabled="True"  Separator="{x:Static LiveCharts:DefaultAxes.CleanSeparator}"/>   
                                                                                    </LiveCharts:LineChart.AxisX>
                                                                                    <LiveCharts:LineChart.AxisY>
                                                                                        <LiveCharts:Axis Title="Y" Color="Gray" IsEnabled="True" StrokeThickness="5" Visibility="Visible">
                                                                                            </LiveCharts:Axis>
                                                                                    </LiveCharts:LineChart.AxisY>

As you can see, I already set the StrokeThickness to 5 but no line appears on the beginning of the graph.

output

Can you kindly help me on this.

Thank you very much.

@Billy-Joel Billy-Joel changed the title X and Y Axis Border are not appearing even though I set the Axis Thickness to 4 X and Y Axis Border are not appearing even though I set the Axis Thickness to 5 May 1, 2016
@beto-rodriguez
Copy link
Collaborator

Oh I am sorry, I forgot to print the axis un the last release, a work around is to use an older verson, 0.6.5 must work

here: https://github.com/beto-rodriguez/Live-Charts/blob/master/LiveChartsCore/Components/Chart.cs#L810

From a conversation in the chat, this will work a little bit different in next relase

@Billy-Joel
Copy link
Author

Thank you very much.... Will try it tomorrow....

@beto-rodriguez
Copy link
Collaborator

beto-rodriguez commented May 20, 2016

Removing the in progress label, I am not sure about this anymore, I introduced a new property Axis.Section (that allow us to highlight value ranges), this actually can be added there, and I think the code would be cleaner, but at the same time I am not sure if the zero value should be a section, I will keep this open to discuss and adding an example when I can

@Billy-Joel
Copy link
Author

Hi Beto,

Good day, congratulation on another great release. I'm very excited to try this update. :)

So without any hesitation I updated the control to the latest release to test, I didn't put any data at first. When I started the application, a null reference exception was thrown by "LiveCharts.ChartUpdater.InitializeSeriesParams".

 <LiveCharts:CartesianChart x:Name="chtVolChart" Margin="5,23,5,5" FontSize="6"  Foreground="#FF472700" Padding="0" MinWidth="100" MinHeight="100" BorderThickness="0" Background="White" >
<LiveCharts:CartesianChart.AxisX>
<LiveCharts:Axis FontSize="6" Title="Pressure (psig)"  StrokeThickness="1" IsEnabled="True" Visibility="Visible">
<LiveCharts:Axis.Separator>
<LiveCharts:Separator   StrokeThickness="0"/>
</LiveCharts:Axis.Separator>
</LiveCharts:Axis>  
</LiveCharts:CartesianChart.AxisX>
<LiveCharts:CartesianChart.AxisY>
<LiveCharts:Axis FontSize="6" Title="DV Solution Gas Oil Ratio (Scf / Bbl)"  IsEnabled="True" StrokeThickness="1" Visibility="Visible">
<LiveCharts:Axis.Separator>
<LiveCharts:Separator  StrokeThickness="1" />
</LiveCharts:Axis.Separator>
</LiveCharts:Axis>  
</LiveCharts:CartesianChart.AxisY>
<LiveCharts:CartesianChart.Series>
<LiveCharts:LineSeries x:Name="lnReported" FontSize="4" Values="{x:Null}"  Title="Reported Data" StrokeThickness="2" IsEnabled="True" PointDiameter="10" Foreground="#FF472700" >
<LiveCharts:LineSeries.Fill>
<SolidColorBrush Color="#FF2195F2" Opacity="0"/>
</LiveCharts:LineSeries.Fill>
</LiveCharts:LineSeries>
<LiveCharts:LineSeries x:Name="lnSimulated" FontSize="6" Values="{x:Null}" Title="Simulated Data" IsEnabled="False" StrokeThickness="0" PointDiameter="5" Foreground="#FF472700">
<LiveCharts:LineSeries.Fill>
<SolidColorBrush Color="#00F34336" Opacity="0"/>
</LiveCharts:LineSeries.Fill>
</LiveCharts:LineSeries>
</LiveCharts:CartesianChart.Series>
  </LiveCharts:CartesianChart>

Is there anything I'm missing from this code?

By the way I'm using an observable collection to update my graph.

Thank you very much for your help.

Regards,
Billy Joel

@beto-rodriguez
Copy link
Collaborator

@Billy-Joel this should be solved in 0.7.1, please update to latest and let me know if this solves your issue

@Billy-Joel
Copy link
Author

Hi, I already updated the controls and encountered the same error. From my observation, it was due to plotting a series with no values on it. The updater seems to update the plot with no values resulting to null reference.

As a workaround what I did is remove the series in the designer and implement it during run time which solve my issue.

Anyway, this control is awesome and really help a lot. :)

@beto-rodriguez
Copy link
Collaborator

I will test it, thanks for your reply, it helps a lot

@beto-rodriguez
Copy link
Collaborator

@Billy-Joel Hello

Ok, the null bugs are already fixed, 0.7 made change a huge part of the code and that is why the appeared again in 0.7

next release should fix them (0.7.3)

about the axis line, I think the best for now is to use an Axis.Section to high light zero

<lvc:CartesianChart Grid.Row="2" Series="{Binding SeriesCollection}" >
        <lvc:CartesianChart.AxisY>
            <lvc:Axis>
                <lvc:Axis.Sections>
                    <lvc:AxisSection FromValue="0" ToValue="0" 
                                              StrokeThickness="3"  Stroke="#F9D648">
                    </lvc:AxisSection>                        
                </lvc:Axis.Sections>
            </lvc:Axis>
        </lvc:CartesianChart.AxisY>

https://github.com/beto-rodriguez/Live-Charts/tree/master/Examples/Wpf/CartesianChart/Sections

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants