This is the discussion forum for OxyPlot.
For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!
+2

Adjust ColumnSeries.ColumnWidth / CategoryAxis.IntervalLength

Chris 8 years ago 0

Hello,

I'm using the current version of Oxyplot.Silverlight. By the way, thx for this great library!


I have a CategoryAxis with 2 stacked column series. They can contain very few items (<10) or a lot of items(>50). The Plotview/x-axis should cover the whole available drawing area, but if there are less than 10 items, the columns get stretched which looks very ugly. Counterwise, if there are more than 50 values, the items are way too thin, so the labels overlap. I already used rotated labels with an angle of 90°.


I did not found a way to force the column width to a specified value without shortening the x-axis too. I already tried ColumnSeries.ColumnWidth and CategoryAxis.IntervalLength, but they didn't work out as expected.


Am I missing something?


Thx in advance for your help.

+2
Under review

WPF tracker multiple value

pitipilot 9 years ago updated by Oystein Bjorke 8 years ago 6
Hi all,
Currently, I've two line series for one plot model. I want to know if it's possible to have a tracker with multiple value like this example :
Image 10

Best regards.
+2

Axis label next to tickmarks

Andrew Strickland 9 years ago updated by chaselfromal 6 years ago 1
I have design that call for have the axis label info to be to the left of the major tick lines. I know how to set the Tick lines below the the axis line, but the only thing I see for label is how to format the text and change the angle. Is there a way to change the position?
+2

Heatmap with non equidistant values

Rainer Worbis 9 years ago updated by Augustin Šulc 7 years ago 1
Is there a possibility to draw a heatmap where the provided values are not spaced equally but in arbitary distances?

Thanks,
Rainer
+2

Rotate series labels.

bkboggy 9 years ago 0
Does anyone know how I can rotate labels? I need it in my situation, where a graph may have a large number of columns, to prevent overlapping of labels, which are at the top of each column. Here's my graph:

Image 20

That's actually a demonstration of best-case scenario, where there's not a whole lot over spilling going on from labels... but if the graph is shrunk, labels begin to be cut-off. I was able to rate the category axis by setting its angle to -90 degrees, but I can't find any way to do the same thing with labels. I've looked through the source code, documentation and examples.
+2
Under review

What should I use instead of LineSeries?

Jeong-hun Sin 10 years ago updated by anonymous 10 years ago 1
I am upgrading from a two-year old version. LineSeries is marked as [Obsolete], but there is no information what class I should use instead.
+2
Under review

Areaseries: Fill area below baseline (realtime)

Steve 9 years ago updated by Oystein Bjorke 8 years ago 3
Hi,
currently I'm implementing a realtime chart and so far I have the following:

Image 18

But I want something like this:

Image 19

Any ideas how to achieve this? Here's the source code:

/// <summary>
/// Setup Plot
/// </summary>
private void SetupPlot()
{
    this.time = DateTime.Now;

    this.Plot = new PlotModel();

    this.Plot.Axes.Add(new LinearAxis() 
                                    { 
                                      IsZoomEnabled = false, 
                                      Maximum = 102, 
                                      Minimum=0, 
                                      MajorGridlineStyle = LineStyle.Solid, 
                                      MinorGridlineStyle = LineStyle.Dot, 
                                      Position = AxisPosition.Left 
                                    });

    this.Plot.Axes.Add(new DateTimeAxis()
                                    {
                                        IsZoomEnabled = false,
                                        Position = AxisPosition.Bottom,
                                    });

    var areaSeries = new AreaSeries()
    {
        StrokeThickness = 2,
        LineStyle = OxyPlot.LineStyle.Solid,
        Color = OxyColors.Blue,
        Color2 = OxyColors.Transparent,
        Fill = OxyColor.FromRgb(214, 231, 242),
        DataFieldX2 = "X",
        ConstantY2 = 0
    };

    // Fill series with initial values
    for (int i = 0; i < 60; i++)
    {
        areaSeries.Points.Add(new DataPoint(DateTimeAxis.ToDouble(time.Subtract(new TimeSpan(0, 0, 60 - i))), 0));
    }

    this.Plot.Series.Add(areaSeries);
}
Update of the Plot (every second):
void timer_Tick(object sender, EventArgs e)
{
    var areaSeries = (AreaSeries)this.Plot.Series[0];

    if (areaSeries.Points.Count > 60)
    {
        areaSeries.Points.RemoveAt(0);
    }
    
    // Update-Plot
    double percentage = GetPercentage();

    areaSeries.Points.Add(new DataPoint(DateTimeAxis.ToDouble(this.time), percentage));
    time = time.AddSeconds(1);
    
    this.Plot.InvalidatePlot(true);
}
Many Thanks!
+2

LineSeries visibility in wpf Crash if not visible

wiyosaya 9 years ago updated 9 years ago 1
I'm using a LineSeries declared in xaml. I am binding an ObservableCollection<DataPoint> to the ItemsSource property. Because of my design, I would like to set the Visibility property on the LineSeries to Collapsed. Then, when I click on a control, I would like to set the Visibility property to Visible via a Style or Binding.

This is all certainly easy enough to do, however, I have found that if the Visibility property is set to Collapsed, datapoints are added to the observable collection, then the Visibility property is set to Visible, a null reference exception is thrown from LineSeries.Render where the code tests actualPoints.Count. It would appear that adding points to a bound observable collection when the LineSeries is not visible, and then changing visibility does not properly update the internal data point collection.

If, however, the visibility property is set to Visible when the observable collection is changed, I can then set the visibility property to anything I want, and all works fine.

Is this a bug?

I can work around this by setting some sort of "AllSeriesInitialized" flag, that keeps all of the series visible until they are all initialized, but it seems that the currently exhibited behavior is not ideal, IMHO.

Thanks.
+2
Under review

Render a part of a series.

fuc2wi 9 years ago updated by justSomeone 9 years ago 2
Hi,

I'm using OxyPlot 2014.1.546.0 in a WPF project. I've 10 stairstep series with each ~11000 Points.
To increase performance I want to render only every nth point depending of the zoom?
Eg: Render every 10th point if I see the whole x-Axis and render every 5th point if I see the half of the x-Axis, and so on?

Thanks for your help in advance.
Best regards
Christian
+2

Individual column/bar selection.

bkboggy 9 years ago updated 9 years ago 6
I've been trying to figure this out all night and haven't managed to find any code or any discussions to assist me with this one.  Similar discussions were focused on points in scatter and line charts, but nothing regarding columns or bars.

I have a requirement of being able to select individual columns in a column chart to access related data; however, none of my attempts at handling selection changed or mouse down produced any viable results.  SelectionChanged event doesn't even fire for me and no visible selection happens.  SelectionColor for the model does not appear to do anything and SelectionMode doesn't produce any visible behavior with selection enabled in the ColumnSeries.