Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative values are not potting #111

Open
SwathiAdari27 opened this issue Nov 16, 2020 · 6 comments
Open

Negative values are not potting #111

SwathiAdari27 opened this issue Nov 16, 2020 · 6 comments

Comments

@SwathiAdari27
Copy link

I have negative linear series(y-axis) which is rendered on graph., even though I have negative values those are not plotting on negative y-axis.

are they any ways to plot negative values on negative (y-axis) ?

@VisualMelon
Copy link

Could you elaborate on your scenario? I don't understand what you mean by a negative axis. If you can provide code or a visual mock-up, that would be most helpful.

Note that each series only plots on 1 pair of X/Y axes (you can't have separate axes for positive and negative Y values: you would need a separate series).

@SwathiAdari27
Copy link
Author

SwathiAdari27 commented Nov 16, 2020

on y-axis I have both negative and positive numbers (e.g y-axis range is -10 to +10)., even though i have datapoints at negative y-axis its not potting on graph

image

the above is graph with negative and positive values on y-axis., the positive values are potting at y-axis but negative values are not plotting.

@VisualMelon
Copy link

VisualMelon commented Nov 16, 2020

Can you provide your code/some reproducing example? It doesn't look like a filtering/multiple-axis/rendering issue (unless there are NaN values in the points?)

Could you also let us know which platform and version you are using (e.g. OxyPlot.WindowsForms v2.0.0)

@SwathiAdari27
Copy link
Author

SwathiAdari27 commented Nov 16, 2020

model.Axes.Add(new LinearAxis
{
Position = AxisPosition.Left,
Minimum = min,
Maximum = max,
AbsoluteMinimum = absMin,
AbsoluteMaximum = absMax,
MajorStep = step,
MajorGridlineStyle = LineStyle.Solid,
MinorTickSize = 0,
MajorTickSize = 0,
TextColor = OxyColor.FromRgb(255, 255, 255),
FontSize = 14,
IsPanEnabled = false,
IsZoomEnabled = false,
StartPosition = 0.1,
EndPosition = 0.90,
});

the above is y-axis

foreach (Record record in GraphData)
{
Series1.Add(record.Date, decimal.ToDouble(record.Value));
}

this is how data is added to lineseries to plot datapoints on graphs.

"GraphData": [
{
"value": 24,
"date": "2020-10-23T00:00:00"
},
{
"value": 35,
"date": "2020-10-21T00:00:00"
},
{
"value": 34,
"date": "2020-10-28T00:00:00"
},
{
"value": 36,
"date": "2020-10-20T00:00:00"
},
{
"value": 25,
"date": "2020-10-29T00:00:00"
},
{
"value": -9,
"date": "2020-10-30T00:00:00"
},
{
"value": -2,
"date": "2020-10-31T00:00:00"
},
{
"value": -26,
"date": "2020-11-02T00:00:00"
}]

this is data passing to lineseries.

even though im passing negative datapoints to plot., its ignoring them and rendering only positive values as shown above

@VisualMelon
Copy link

I'm not able to repro this on Winforms (I'm not set up to test Xamarin), and can't recall any bugs like this in the past. Could you confirm which version of Oxyplot you are using?

What is the Add method doing? Can you check that the line series' Points collection is correctly populated, or that ActualPoints (protected property) is populated if you are using an ItemSource.

@SwathiAdari27
Copy link
Author

about version - added as a library not as an dll

add method adds lineseries to plot.
not using any ItemSource property to override previous values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants