question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello. I want to use LiveChart 2 in Avalonia project. I set IsVisible = false in XAxis and YAxis to hide labels, but now there is empty space. How can i hide it? Thanks. Screen

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
beto-rodriguezcommented, May 7, 2021

the empty space is not caused by the axis, it is caused by the series, notice all the series have a blank distance between the start of the axis and the first point of the series.

Series.DataPadding should do the trick, docs are not ready yet, but you can try something like:

new LineSeries<int> 
{ 
    Values = new []{ 1, 5, 4, 2, 7, 4, 6, 8 },
    DataPadding = new System.Drawing.PointF(0, 1)
}

for both X and Y axes: 0 means nothing, 1 means the Axis tick, an Axis tick is the distance between the labels in the axis (even if there are not visible labels, the tick is calculated).

1reaction
beto-rodriguezcommented, May 9, 2021

I have also seen this issue, I am not sure yet, but I think this is an Avalonia issue.

The problem is when the chart clears the canvas with a transparent color, Avalonia has not drawn anything behind our chart control, then we get this result.

The workaround I built for the library, is that based on the Background color of the chart I pull a color to clear the canvas:

This is the workaround, and it is not working in your case because it was not able to build a color from null, just set a color for now, or open an issue in Avalonia, I am not completely sure yet, but I am almost sure that the issue is theirs. https://github.com/beto-rodriguez/LiveCharts2/blob/master/src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/CartesianChart.axaml.cs#L325

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to hide <label for=""> CSS
Hiding the label with display: none; is bad for web accesibility and you shouldn't do it. Try visibility: hidden; instead.
Read more >
HTML label hidden Attribute
The hidden attribute hides the <label> element. You can specify either 'hidden' (without value) or 'hidden="hidden"'. Both are valid. A hidden <label> ...
Read more >
How can I hide taskbar labels in Windows 10 without ...
Under taskbar settings, choose "Always, hide labels". Use one of the following options to disable taskbar combining: option1: edit the registry.
Read more >
Hide taskbar labels - Windows 10
Right click a blank area on the taskbar and choose Taskbar Settings. Under Combine Taskbar Buttons, choose Always, hide labels. Exit Settings.
Read more >
How to Hide Field Labels on Your Form
Hiding Specific Field Labels · In the Form Builder, select the element's gear icon to open properties. · In the properties pane on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found