Quantcast
Channel: OxyPlot (moved to GitHub)
Viewing all 2061 articles
Browse latest View live

Created Unassigned: Is there no "PlotView" in Xamarin.Android? [10233]

$
0
0



namespace REMS_TST
{
[Activity(Label = "REMS_TST", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : Activity
{
int count = 1;

protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);

// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);

// Get our button from the layout resource,

_____PlotView_____

__Question one: Is there no "PlotView" in Xamarin.Android???
How to set the __PlotModel showing???

}




public static PlotModel BaseValuestacked()
{
var plotModel1 = new PlotModel();
plotModel1.Subtitle = "BaseValue = -1";
plotModel1.Title = "BaseValue (stacked)";
var categoryAxis1 = new CategoryAxis();
categoryAxis1.MinorStep = 1;
categoryAxis1.Title = "Category";
categoryAxis1.Labels.Add("A");
categoryAxis1.Labels.Add("B");
categoryAxis1.ActualLabels.Add("A");
categoryAxis1.ActualLabels.Add("B");
plotModel1.Axes.Add(categoryAxis1);
var linearAxis1 = new LinearAxis();
linearAxis1.MinimumPadding = 0;
plotModel1.Axes.Add(linearAxis1);
var columnSeries1 = new ColumnSeries();
columnSeries1.BaseValue = -1;
columnSeries1.IsStacked = true;
columnSeries1.Title = "Series 1";
columnSeries1.Items.Add(new ColumnItem(1, -1));
columnSeries1.Items.Add(new ColumnItem(2, -1));
plotModel1.Series.Add(columnSeries1);
var columnSeries2 = new ColumnSeries();
columnSeries2.BaseValue = -1;
columnSeries2.IsStacked = true;
columnSeries2.Title = "Series 2";
columnSeries2.Items.Add(new ColumnItem(4, -1));
columnSeries2.Items.Add(new ColumnItem(7, -1));
plotModel1.Series.Add(columnSeries2);
return plotModel1;
}



}
}


New Post: How to calculate the screen length of two points?

$
0
0
Help me! I am using WindowsForms. My xAxis is DateTimeAxis, and yAxis is LinearAxis. I have two DataPoint, A and B, I want to calculate the screen length of A and B. In what way can i accomplish this? Thanks.! Image

New Post: How to calculate the screen length of two points?

$
0
0
This method in Axis will probably help:
xAxis.Transform(double x, double y, Axis yAxis);

Created Unassigned: Legend does not display with multiple plots in tab [10234]

$
0
0
I have a setup generating a series of plots in a Winforms TabControl (3 per page, 4 tabs for a total of 12 plots). When only one plot is present in the tab, the legend displays fine in that plot; once multiple plots are present, however, the legend vanishes in each. This occurs even when PlotModel.IsLegendVisible is explicitly set to true.

New Post: LineSeries always visualize Y value

$
0
0
I can't find a way to have the Y axis value visible, it shows randon values, sometimes min and max, sometimes in between.
Image
I've tried to set minimin and maximun but no luck.
Any hint?
Thank you.

New Post: LineSeries always visualize Y value

$
0
0
I've actually proposed that this be implemented for axes in general here. If you require it immediately though it shouldn't be too hard to extend your own axis and override paint to always print out the value on the absolute min and max (using the InverseTransform to get the value, I think). This is about as far as I've thought out how to implement it though, if you create a solution please share =).

Side note: a simple fix would be to alter MajorStep and MinorStep, and ShowMinorStep, but that'll only make them more frequent, not always show on the min and max.

New Post: LineSeries always visualize Y value

$
0
0
Yep good advice, I will try to override it.
Thanks for your help and I agree, your proposal should be implemented.

New Post: Always show two tick labels on y axis

$
0
0
Is it possible to force at least two tick labels on a linear y axis? My plot has limited height and sometimes it will only show one major tick. In that scenario it is impossible to determine the value of a point because don't know the value of the major/minor steps.

I tried setting the MajorStep to something smaller then the difference between the max and the min of the datapoints, but that doesn't seem to work.

New Post: LineSeries always visualize Y value

$
0
0
I actually came up with a different solutions but I am not sure if it works with any value:

First I calculate the Maximun and Minimun and set them in the axe, then I set the MajorStep = MAximun - Minimun.

It works only for integers but for me it's enough till your advice will be implemented.

EDIT: forget it, it's bullshit, it works randomly... sic...

New Post: Drag & Drop

$
0
0
I don't know why the image can't display! but you can click the link to look at it.
Can These images help understand my ideas?

New Post: Auto Pan Oxyplot DateTimeAxis

$
0
0
This is a continuation of the question posted here: Auto-scroll/pan for real-time data.

While the posted example appears to work for a LinearAxis, it doesn't work for a DateTimeAxis.
The pan steps are far too large, jumping extremely long distances.
var now = DateTimeAxis.ToDouble(DateTime.Now);
data.Points.Add(new DataPoint(now, yValue));

if (data.Points.Count > 3)
{
    //panStep is -6045706.002716762
    double panStep = timeAxis.Transform(timeAxis.Offset - 1); 
    timeAxis.Pan(panStep);
}
Q: What is the correct was to autopan a DateTime axis?

New Post: Oxyplot Xamarin.Forms Version

$
0
0
Hi, just found about OxyPlot and it looks really amazing, i have to say i didn't tried yet, but it looks a great open source tool for lob apps.
So Xamarin has this new platform that is Xamarin.Forms, it's pcl based, and me and others have a open source project to share some common functionally not present yet in the platform : https://github.com/XForms/Xamarin-Forms-Labs

One of the features i thought about working on that project was Simple Chart support:
https://github.com/XForms/Xamarin-Forms-Labs/issues/38

After finding about Oxyplot and that it has all the platform support that Xamarin Forms needs, IOS; Android; WP8, i think this can be used also in Forms if we just work on some wrappers.

So what i wanted to discuss, if it sounds good to work in a new branch here for Xamarin.Forms support.

Thanks.
Best Regards
Rui

New Post: Lineseries.Color bug, help

$
0
0
Hi all, thanks for the library!
I wanna keep the color patter of creating the new line while getting the color of the line plotted. But this: OxyPlot.WindowsForms.ConverterExtensions.ToColor(tmpLine.Color); code will always return same color value back.
Thanks a lot!
foreach (Plot plotItem in _plots)
            {
                var tmpLine = new LineSeries();
                tmpLine.Points.AddRange(plotItem._resampledPoints);
                tmpLine.StrokeThickness = plotItem._thickness;
                tmpLine.LineStyle = plotItem._style;
                if(_showLineTitle)
                    tmpLine.Title = plotItem._name;
                if (!(plotItem._color.Equals(System.Drawing.Color.White)))
                    tmpLine.Color = plotItem._color.ToOxyColor();
                plotItem._color = OxyPlot.WindowsForms.ConverterExtensions.ToColor(tmpLine.Color);
                model.Series.Add(tmpLine);
            }

New Post: Rectangle Annotation Problem

$
0
0
Hi,
it's me again^^ I have a problem with the Rectangle Annotation.
I need 2 annotations for my plot. I get this done, but one of my annotations is going endlessly in the y-axis although i've set an maximumY.

Here is my code:
var recAnnotation1 = new RectangleAnnotation();
            recAnnotation1.MinimumX = 0;
            recAnnotation1.MinimumY = 0;
            recAnnotation1.MaximumY = listItem[listItem.Count - 1].WealthList;
            recAnnotation1.Fill = OxyColor.FromArgb(99, 255, 0, 0); ;

            var recAnnotation2 = new RectangleAnnotation();
            recAnnotation1.MinimumY = 0;
            recAnnotation2.MinimumX = 0;
            listItem.Sort(delegate(ListCarrier l1, ListCarrier l2) { return l1.WealthList.CompareTo(l2.WealthList); });
            recAnnotation2.MaximumY = listItem[listItem.Count - 1].WealthList;
            recAnnotation2.Fill = OxyColor.FromArgb(99, 0, 128, 0);

            temp.Series.Add(ls);
            temp.Annotations.Add(recAnnotation2);
            temp.Annotations.Add(recAnnotation1);
Here's a screenshot:
http://imgur.com/GpBUlRv

New Post: Lineseries.Color bug, help

$
0
0
You're using extensions wrong, might want to look into them more =P. Try just doing
tmpLine.Color.ToColor();

New Post: Adding multiple instances of a LineSeries to OxyPlot

$
0
0
Hello,

I am trying to add multiple LineSeries to my OxyPlot graph. I am using WPF so I decided to switch to OxyPlot. I am not used to the way OxyPlot works as I am used to using Winforms chart controls so please bare with me. I have read the example project code for plotting multiple series on a PlotModel, but this does not seem to be helping me.

My approach so far:

I am taking a c# List array and adding a new copy of the LineSeries that holds new data to be plotted. My code:
        // Function to plot data
        private void plotData(double numWeeks, double startingSS)
        {

            // Initialize new Salt Split class for acess to data variables
            Salt_Split_Builder calcSS = new Salt_Split_Builder();
            calcSS.compute(numWeeks, startingSS, maxDegSS);

            // Create the OxyPlot graph for Salt Split
            OxyPlot.Wpf.PlotView plot = new OxyPlot.Wpf.PlotView();
            
            var model = new PlotModel();

            // Add Chart Title
            model.Title = "Salt Split Degradation";

            // Create new Line Series
            LineSeries linePoints = new LineSeries() { StrokeThickness = 1, MarkerSize = 1, Title = numWeeks.ToString() + " weeks" };


            // Add each point to the new series
            foreach (var point in calcSS.saltSplitCurve)
            {
                DataPoint XYpoint = new DataPoint();
                XYpoint = new DataPoint(point.Key, point.Value * 100);
                linePoints.Format("%", XYpoint.Y);
                linePoints.Points.Add(XYpoint);
            }

            listPointAray.Add(linePoints);


            // Define X-Axis
            var Xaxis = new OxyPlot.Axes.LinearAxis();
            Xaxis.Maximum = numWeeks;
            Xaxis.Minimum = 0;
            Xaxis.Position = OxyPlot.Axes.AxisPosition.Bottom;
            Xaxis.Title = "Number of Weeks";
            model.Axes.Add(Xaxis);

            //Define Y-Axis
            var Yaxis = new OxyPlot.Axes.LinearAxis();
            Yaxis.MajorStep = 15;
            Yaxis.Maximum = calcSS.saltSplitCurve.Last().Value * 100;
            Yaxis.MaximumPadding = 0;
            Yaxis.Minimum = 0;
            Yaxis.MinimumPadding = 0;
            Yaxis.MinorStep = 5;
            Yaxis.Title = "Percent Degradation";
            model.Axes.Add(Yaxis);

            // Add Each series to the
            foreach (var series in listPointAray)
            {
                LineSeries newpoints = new LineSeries();
                newpoints = linePoints;
                model.Series.Add(newpoints);
            }


            // Add the plot to the window
            plot.Model = model;
            SaltSplitChartGrid.Children.Add(plot);
            
        }
My code works the first time I press my "Graph Data" button, but fails on consecutive attempts with the following error:
The element cannot be added, it already belongs to a Plot Model
The following plot is the type of plot I would like to produce (it worked fine using WinForms Chart control):

Image


I would like a new line with a new color to be plotted each time I run the method.

New Post: Drag & Drop

$
0
0
Using imgur.com instead of SkyDrive might help, but anyway this sounds like something that is out of scope for OxyPlot to provide, as drag and drop functionality is on the Frame level if I recall correctly.

Just as an idea you could try serializing the Series you click on and saving it outside of the PlotView, and removing it from the PlotModel. Have some kind of fancy draging image on the cursor then when the mouse button is released have the program check for a PlotView where the mouse cursor is, deserialize the Series and add it to this PlotView (I may be over thinking the serialization though, probably could just be an object).

I haven't played with drag and drop functionality since I was working on UIs in Python and Qt, so it's been a while, but hopefully this helps.

New Post: Always show two tick labels on y axis

$
0
0
Hey! I've actually proposed this here and talked about how to implement it a bit here. Maybe these will help a bit. I'm sure whenever Objo comes around again he'll add some feedback too, he hasn't been on since July 11th, so I'm guessing he's on vacation or something.

New Post: Always show two tick labels on y axis

$
0
0
Your proposal would solve my problem indeed, thanks for the reply.

New Post: Lineseries.Color bug, help

$
0
0
Every time the tmpLine.Color will always give me {#00000001} while the actual color is not. I've tried changing my code to This:
foreach (Plot plotItem in _plots)
            {
                var tmpLine = new LineSeries();
                tmpLine.Points.AddRange(plotItem._resampledPoints);
                tmpLine.StrokeThickness = plotItem._thickness;
                tmpLine.LineStyle = plotItem._style;
                if (_showLineTitle)
                    tmpLine.Title = plotItem._name;
                if (!(plotItem._color.Equals(System.Drawing.Color.White)))
                    tmpLine.Color = plotItem._color.ToOxyColor();
                plotItem._color = tmpLine.Color.ToColor();

                model.Series.Add(tmpLine);
            }
Thanks so much!
Viewing all 2061 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>