Tobias
Tobias

Reputation: 1564

WPF livechart not renderring correctly

I'am using livecharts to display 3 Solid Gauges.
The "Value" and "To" Values are a simple Bindings.
My third chart displays the correctly Value as Label, but the ActiveFill wont show up correctly.

screenshot of the actual result

My xaml:

<lvc:Gauge
        Width="100"
        Height="100"
        Margin="0,10,270,0"
        HorizontalAlignment="Right"
        VerticalAlignment="Top"
        FontFamily="Roboto Black"
        Foreground="#fff"
        GaugeActiveFill="#c82333"
        GaugeBackground="#FF202225"
        Value="{Binding DescError}"
        From="0"
        To="{Binding DescCount}" />
    <lvc:Gauge
        Width="100"
        Height="100"
        Margin="0,10,150,0"
        HorizontalAlignment="Right"
        VerticalAlignment="Top"
        FontFamily="Roboto Black"
        Foreground="#fff"
        GaugeActiveFill="#e0a800"
        GaugeBackground="#FF202225"
        Value="{Binding DescWarning}"
        From="0"
        To="{Binding DescCount}" />
    <lvc:Gauge
        Width="100"
        Height="100"
        Margin="0,10,40,0"
        HorizontalAlignment="Right"
        VerticalAlignment="Top"
        FontFamily="Roboto Black"
        Foreground="#fff"
        GaugeActiveFill="#28a745"
        GaugeBackground="#FF202225"
        Value="{Binding DescOk}"
        From="0"
        To="{Binding DescCount}" />

I have no idea why this happens.
The bindings are all ok, right values are there. Anyone out there with an idea?

Upvotes: 3

Views: 1566

Answers (2)

maerzman
maerzman

Reputation: 111

I had the same Issue and what I found out was that, at least for me, it is always the Gauge at the very bottom of the code which does not function properly. So a little workaround from my side was to just add another Gauge which has no functionality and is invisible by setting the GaugeActiveFill and the Foreground Property to the Color of the Background. Also set Height="0" and Width="0"

e.g.:

<lvc:Gauge Height="0" Width="0"
               Uses360Mode="True"
               From="0" To="1" Value="1" Foreground="White" GaugeActiveFill="White"/>

might not be a very professional Solution but I found no other way to fix this issue

Upvotes: 3

Jamez Fatout
Jamez Fatout

Reputation: 392

Test with Padding. Change the Padding from the "4". This will be remove the pixels.

Upvotes: -1

Related Questions