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

Format axis labels

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

amity2001 wrote at 2013-04-03 13:53:

Hello world,

I have values (Y axis) against time stamp (in milliseconds) (X axis) to display plot.

It is working file with OxyPlot.

I want to show x axis label in terms of seconds instead of milliseconds.

Is it possible with OxyPlot to format X axis labels containing milliseconds to show them as seconds?

Thanks in advance.

Multiple views of a single plot model

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

xsquare wrote at 2013-09-11 15:53:

Greetings!

The program I am working on supports the possibility to view the same set of data in multiple windows simultaneously. The data is updated in all the windows at the same time. Some data is displayed as an OxyPlot plot which is bound to a model of the plot.

The problem is that OxyPlot allows only one view of the plot per model and when trying to display multiple views I get this exception
Image
How can I solve this problem without making copies of the plot model?


Thank you in advance for your answers.

objo wrote at 2013-09-11 20:02:

Sorry, this is the design of the PlotModel (it is a ViewModel) - you need to create one instance for each view.
But you should not need to duplicate data, you can share the same data source for the series!

Limit contour plots to a region

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

tboehme wrote at 2012-11-26 08:35:

Hello,

I would like to know if it is possible in OxyPlot to restrict a contour plot to be only plotted inside a given polygon.

Best regards,
Thomas


objo wrote at 2012-11-26 08:39:

Sorry, the current implementation only clips to the rectangle defined by the 'plot area'.

"OxyPlot.Wpf.LineSeries" does not have "BrokenLineXXX" properties

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

zhlei616 wrote at 2013-10-02 23:46:

Hi,
I want to display broken lines in my WPF app. However I found that the "OxyPlot.Wpf.LineSeries" is different with "OxyPlot.Series.LineSeries".
The "BrokenLineXXX" properties are only included in "OxyPlot.Series.LineSeries", how can I display the broken lines in WPF LineSeries?

Thanks,
Larry

everytimer wrote at 2013-10-03 09:21:

I don't quite understand how are you implementing that LineSeries (directly in XAML maybe?). You can use the OxyPlot version in your model (bound to your plot in XAML). The Wpf version does not include many of general OxyPlot features but you still be able to access them this way. Good luck

objo wrote at 2013-10-03 19:34:

I would like to automate the generation of the Wpf series/axis/annotation classes, but this is not done yet.
I have added the properties you were missing!

zhlei616 wrote at 2013-10-04 00:49:

everytimer wrote:
I don't quite understand how are you implementing that LineSeries (directly in XAML maybe?). You can use the OxyPlot version in your model (bound to your plot in XAML). The Wpf version does not include many of general OxyPlot features but you still be able to access them this way. Good luck
Yes, you're right, I implemented it in XAML directly.
Thanks for your anwser, I got it, I'll use PlotModel to implement it.

zhlei616 wrote at 2013-10-04 00:49:

objo wrote:
I would like to automate the generation of the Wpf series/axis/annotation classes, but this is not done yet.
I have added the properties you were missing!
Thanks objo!

Plotting against the right Y-Axis.

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

vdepa wrote at 2012-03-05 08:29:

Hi All,

I am facing one probelm.

In my application i have many plot lines which will plot with  the left Y-Axis  and the bottom X-Axis.

In the same plot I need to draw with the right Y-Axis and the bottom X-Axis.

But when i draw using  the line series  my plot is always taking the left Y-Axis Scale. Below is the sample code for Y-Axis. It is always taking the Left Y-Axis Scale only,

S1.Point.Add(new DataPoint(i,i+10)).  where S1 is the line series.

Can anyone please assist me and share the code for drawing the plot with the Left Y-Axis VS Bottom X-Axis and Right Y-Axis VS Bottom X-Axis. Bottom X-Axis is common for  both the Y-Axis.

Is the  above feature not available in Oxyplot.? Please help me.

Thanks & Regards

Vijender.

 


ffiala wrote at 2012-03-05 11:34:

I am using the property Axes.Key to give an axis a name and then reference to this name using the properties XAxisKey, YAxisKey of a series.

a.Key = "yAxesName";
...
YAxisKey = "yAxesName";

 

Franz


anomistu wrote at 2012-03-05 12:10:

Yes, linking series and axes by AxisKey is the way to do it. However, you can only manipulate the first added vertical axis from the plot area.

This will hopefully be fixed with issue 9945, Synchronized axes.

0
Under review

LabelFormatter in DateTimeAxis

Rainer Worbis 10 jaar geleden bijgewerkt door anonymous 10 jaar geleden 1
While in Axis.cs in the method FormatValue the LabelFormater is checked and called this is not the case in DateTimeAxis.FormatValue. Please add the check/call to LabelFormater there also.
Thanks,
Rainer

OutOfMemoryException with ItemsControl

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

sharethl wrote at 2014-07-03 01:24:

Updated: 7/3/2014
I will fire an issue.
OutOfMemoryException is not related to ItemsControl.
It is related to LineSeries.Smooth = true.

Exception at : CanonicalSplineHelper.Segment(). Line207.

How to reproduce this:
  1. Set lineSeries.Smooth = true when create lineSeries.
    eg: var ls = new LineSeries { Title = title,Smooth = true};
  2. Zoom in by pushing down mid-mouse button, create rectangle zoom area.
  3. after several times, out of memory exception throws.
Image

Tested with version oxyplot-d91d95940aa9

how to Set scale for plot or axe

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

ProCodeMyth wrote at 2012-04-29 15:58:

hi objo,

    i want to plot a larger graphic in oxyplot ,  for example , x axe range in (0-3000), oxyplot default plot whole range in windows ,

the result plot show too little and dense  , i don't know how to set single axis Scale (protect set), please help me 

 very thanks

 


objo wrote at 2012-04-30 16:06:

Set the Maximum and Minimum values to limit the range of the axis. It will still be possible to pan/zoom outside this range. 

You can also set the AbsoluteMaximum and AbsoluteMinimum values if you don't want to allow panning/zooming outside the given range.

Yes, the Scale property setter is protected, you should the public properties to change the scale.

PieSeries Graphic: Question about Texts

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

Auriou wrote at 2014-05-26 09:24:

I have two questions about a chart with a PieSeries:
  • Is it possible to set a different color for the text inside the graph and one for the outside of a graph?
    Example:
          pieSeries.TextColor = OxyColors.Black; 
          pieSeries.InnerTextColor = OxyColors.White; (New imagine property)
    
  • Is it possible to reverse the texts of the graph have the percentage within the graph and labels outside
         pieSeries.PercentagePlacementInside = true;  (New imagine property)

Auriou wrote at 2014-05-31 15:35:

I found the solution to reverse the two text
            pieSeries.OutsideLabelFormat = "{1}";
            pieSeries.InsideLabelFormat = "{2:0} %";
I created a Fork to offer a solution to the text inside the Pie in another visible color
            pieSeries.TextColor = OxyColors.Blue;
            pieSeries.InnerTextColor = OxyColors.White;

Strange behavior on zooming/moving

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

pvyhlas wrote at 2014-04-29 16:25:

Hi,

When I right click on chart or scroll with wheel, charts automatically zooms to strange position, (0,0) + data.

Package version 2014.1.296.1

xaml code
<Window x:Class="OxyPlotTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:oxy="http://oxyplot.codeplex.com"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <oxy:Plot>
            <oxy:LineSeries x:Name="Test" Title="Test" ItemsSource="{Binding}" />
        </oxy:Plot>
    </Grid>
</Window>
code behind
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace OxyPlotTest
{

    public class Model
    {
        public double X { get; set; }
        public double Y { get; set; }


    }

    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        protected ObservableCollection<Model> TestData;

        public MainWindow()
        {
            TestData = new ObservableCollection<Model>();
            TestData.Add(new Model() { X = 150000, Y = 10000 });
            TestData.Add(new Model() { X = 150002, Y = 10000 });
            TestData.Add(new Model() { X = 150004, Y = 10000 });
            TestData.Add(new Model() { X = 150006, Y = 10000 });
            TestData.Add(new Model() { X = 150008, Y = 10000 });
            TestData.Add(new Model() { X = 150010, Y = 10000 });
            TestData.Add(new Model() { X = 150012, Y = 10000 });
            TestData.Add(new Model() { X = 150014, Y = 10000 });

            InitializeComponent();
            Test.DataContext = TestData;
            Test.Mapping = (x) => { var m = x as Model; return new OxyPlot.DataPoint(m.X, m.Y); };
        }
    }
}
Any advice how to change this behavior to keeping its display context?

Thanks.

pvyhlas wrote at 2014-05-06 21:49:

Solved by manually adding axes to plot.