Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I just discovered LiveCharts2 for a WPF project, nice tool, used it for my project, everything fine.

But now, the customer:
In a bar chart he wants some of the bars solid, some hatched.
No problem with different bars, but how do I get a *hatched* bar?

Second solution:
Or do you know another Library with this feature?

Thank you very much!

What I have tried:

I searched the LiveCharts-examples (there is no hatched bar) and the web, I tried to find a useful class for the Fill-parameter, but could not find a solution...
Updated 30-Jul-23 22:16pm

1 solution

Best place to ask is here: Issues · beto-rodriguez/LiveCharts2 · GitHub[^] or here: Questions tagged [livecharts] - StackOverflow[^]

But... looking at the documentation I found this: CartesianChart.Column series props - LiveCharts2[^] which points to this: Overview.Paints - LiveCharts2[^]

It looks like you need to create a custom Paint. Here is the code for a SolidColorPaint: LiveCharts2/src/skiasharp/LiveChartsCore.SkiaSharp/Painting/SolidColorPaint.cs at master · beto-rodriguez/LiveCharts2 · GitHub[^] and here is a StackOverflow answer that shows how to do a HatchPaint: SkiaSharp - how to create a hatch or dotted pattern on the filled space between curves[^]. You will need to make your own by combining the default with the SO answer method.
Share this answer
M.Vo. 1-Aug-23 2:30am    
my best thanks for your quick reaction and the redirection!
Graeme_Grant 1-Aug-23 3:25am    
You are most welcome. Good luck with it!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900