Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
513 views
in Technique[技术] by (71.8m points)

c# - Column Series With different color on a different interval at x-axis fill in same series?

I'm trying to implement a speed/time plot UI, i'm using WPF with the MVVM Pattern and Live-Charts by beto-rodriguez as my plot library. I am using Column Series.

i have two issues: 1) i have to start the series in middle of the x-axis how to do this? e.g if i set the min value as 7 the graph starts the x axis as 7 taking it the first point but i want x - axis to start at 1 but graph plotting should start at 7.

2) i have to change the color of the series at a certain condition say when x= 10 i want it to be shown as blue but when x= 17 i want to show the same series as pink only for that value rest at all points it should be of the original color.

Any Pointers?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You have a couple of options:

Use a different series for every point:

<lvc:CartesianChart>
   <lvc:CartesianChart.Series>
      <lvc:ColumnSeries Fill="Red" />
      <lvc:ColumnSeries Fill="Blue" />

You can use set them using a mapper, for example: https://lvcharts.net/App/examples/v1/wpf/Point%20State


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...