
Additional ticks in DateTimeAxis
ffiala wrote at 2012-02-23 12:40:
During my first experiments with OxyPlot I found the following detail:
When using a scale of one or ten years the scale is error free.
Example:
http://oxyplot.iam.at/examplesvg.aspx?title=DateTimeAxisFiala.DateTime+axis1+Fiala
But when using a scale of 100 years additional and smaller ticks can be seen on the time axis at 1930, 1960 and 1990).
Example: http://oxyplot.iam.at/examplesvg.aspx?title=DateTimeAxisFiala.DateTime+axis2+Fiala
Code: http://oxyplot.iam.at/examplecode.aspx?title=DateTimeAxisFiala.DateTime+axis2+Fiala
Am I missing a setting?
Thank You, Franz
objo wrote at 2012-02-23 22:16:
Thanks for attaching the example, getting the code makes it much easier to reproduce the bugs!
Sorry, the DateTimeAxis is not completed yet - I see it does not work properly with long (100 years) time ranges.
I tried setting the IntervalType = DateTimeIntervalType.Years (which should force the axis to show years only). I also think that part of the problem is that MajorStep/MinorStep (in days) cannot handle leap years properly. A solution could be to give Minimum/Maximum/MajorStep/MinorStep in years when the Interval type is Years.
Workaround: Can you use a LinearAxis with years as numbers instead?
Can I include your example as a test we can use to get the "long-term" DateTimeAxis working?
ffiala wrote at 2012-02-24 16:07:
Thanks for the advice to use LinearAxes instead of DateTimeAxes. This version now works perfectly.
Example: http://oxyplot.iam.at/examplesvg.aspx?title=DateTimeAxisFiala.DateTime+axis3+Fiala
Code: http://oxyplot.iam.at/examplecode.aspx?title=DateTimeAxisFiala.DateTime+axis3+Fiala
In this example the given dates are yyyy-01-01 so the numbers forming the data series appear as integer values. I am using a conversion function to convert each DateTime value down to milliseconds into an double value considering the leapyears. May be You can use the conversion function to get a certain datetime number:
static double DateToNumber(DateTime date) { int[] DaysToMonth = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int Year = date.Year; bool IsLeapYear = ((Year % 4 == 0) && (Year % 100 != 0)) || (Year % 400 == 0); int LeapDay = IsLeapYear && (date.Month > 2) ? 1 : 0; long SecondsPerYear = (365+LeapDay) * 24 * 60 * 60; double TimeInYears = Year + (date.Millisecond*1.0/1000 + date.Second + date.Minute * 60 + date.Hour * 3600 + (date.Day-1 + LeapDay + DaysToMonth[date.Month-1]) * 3600 * 24)/SecondsPerYear; return TimeInYears; }
It works exactly up to yyyy-12-31 24:59:59.999
Some of my DateTime experiments:
Example1:http://austr.iam.at/?cmd=cat&arg=153
Example2:http://austr.iam.at/?cmd=cat&arg=86
(You can use all of these functions.)

Disabling Line Tracker (coordinate display)
ryoujr wrote at 2013-07-23 23:06:
Is there any newly implemented feature to disable line tracker for each line series? I have 3 line series and I'd like to display tracker only on one line.
Actually, I could find some information posted last year and at that time there was no that kind of option or API, but I would like to know if it is possible now.
Thank you in advance and Regards,
Ian.
raphay wrote at 2013-07-24 13:29:
I hope this will help you.

CategoryAxis: How to programmatically pan with ColumnSeries question
I have a PlotView (I'm using Xamarin.Forms) and show a ColumnSeries by using a LinearAxis on the left and a CategoryAxis on the bottom.
The ColumnSeries is displayed correctly. Is there a way to pan the column bars to the left programmatically via code behind (c#)?
Currently I have a fixed number of bars (12). When new data comes in I remove the index 0 from the columnSeries items and add the new one to the end of the list. If I Invalidate the plotView it looks like the bars got slided to the left with one new value added. But this looks very rough because the bars get shifted by 1 bar width.
I want to pan the bars to the left before I add the new value to get a smooth shifting look. Is there a way to do this by panning the
categoryAxis somehow in code behind?
Thanks! :-)

Importing SVG
etrgyphon wrote at 2014-01-03 16:21:
Is that outside the scope of this project?
objo wrote at 2014-01-07 22:03:
I want to implement a drawing model that should make it possible to include drawings in plots, but this should be very simple (not including svg import).
I would use an external library:
https://github.com/vvvv/SVG
https://sharpvectors.codeplex.com/

PointTracker for Winform (simple implementation)
heromyth wrote at 2012-05-09 04:29:
It's using a TextLabel to implement the tracker. It's just better than nothing.
diff -r 93124cd413d6 Source/OxyPlot.WindowsForms/Plot.cs
--- a/Source/OxyPlot.WindowsForms/Plot.cs Thu Apr 26 21:11:20 2012 +0200
+++ b/Source/OxyPlot.WindowsForms/Plot.cs Wed May 09 10:21:11 2012 +0800
@@ -223,6 +223,7 @@
/// </summary>
public void HideTracker()
{
+ m_label.Visible = false;
}
/// <summary>
@@ -381,8 +382,20 @@
/// </param>
public void ShowTracker(TrackerHitResult data)
{
- // not implemented for WindowsForms
+ if (m_label == null)
+ {
+ m_label = new Label();
+ m_label.Parent = this;
+ m_label.BackColor = Color.LightSkyBlue;
+ m_label.AutoSize = true;
+ }
+
+ m_label.Text = data.ToString();
+ m_label.Top = (int)data.Position.Y - this.Top;
+ m_label.Left = (int)data.Position.X - this.Left;
+ m_label.Visible = true;
}
+ private Label m_label;
/// <summary>
/// The show zoom rectangle.
objo wrote at 2012-05-11 00:17:
thanks for the code, I will add this soon! I agree that a Label is better than nothing :)
objo wrote at 2014-02-02 20:57:

make "virtual internal" to "virtual internal protected" to PreTransform and PostInverseTransform Axis baseclass
chage wrote at 2014-03-26 19:27:
Good day. One question/request...
is there a reason not having PreTransform and PostInverseTransform declared as protected since it is marked as virtual for overriddes.
I have derived a custom axis class that requires PreTransform and PostInverseTransorm to be overridden (a norm std distribution z-index axis). I had it in OxyPlot assembly previously which is fine when they were internal only. I found that it creates alot of work when i merge with your code from time to time.
So decided to move the custom axis class out of the assembly, but hit into limitation of these method not being protected.
if possible, please mark those protected so it doesnt defeat the purpose of having the derived class overrides them.
thanks again for the cool library.
objo wrote at 2014-03-26 20:07:
CalculateActualMaximum
, CalculateActualMinimum
and
UpdateTransform
methods in the Axis
class. So I agree with you, let use change to protected to allow overriding in custom axes!
ps: it is very cool to hear of such advanced use of the library!
chage wrote at 2014-03-26 21:05:

MouseClick point label cut off
I'm working on some simple column charts and line series graphs. I really like that the feature for clicking on a bar/ point automatically shows the values. However, in my current charts, when you click on the last column to the right for example, the text of the point label is cut off. Is there a way to get this to flip (show to the left of the mouse) when you get too close to the margins of a plot or form? I've seen functionality similar to what I'm looking for in the Example Browser but this part doesn't seem to be shown in the code. Thanks in advance for any help!

Change the color of markers in line series in WPF?
oriches wrote at 2014-05-08 17:33:
objo wrote at 2014-05-08 18:36:
LineSeries
. But it should be possible to use a
ScatterSeries
to draw the markers with different colors!oriches wrote at 2014-05-08 18:57:
oriches wrote at 2014-05-08 19:30:
objo wrote at 2014-05-10 23:19:
ScatterPoint.Value
that can be used to define the color of the points in a
ScatterSeries
. Also remember to set the ScatterSeries.ColorAxis
.
Version 2013.2.106.1 Marker problems
CatalinMurariu wrote at 2013-10-25 11:06:
After updating to last version the markers don't get drawn on the line series anymore, although they do get drawn on the legend. Any hotfix for this?
objo wrote at 2013-10-25 22:35:
CatalinMurariu wrote at 2013-10-28 15:19:

MatrixSeries custom color for each value
everytimer wrote at 2013-07-22 22:48:
everytimer wrote at 2013-07-22 22:59:
if (this.image == null)
{
var pixels = new OxyColor[m, n];
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
var c = OxyColor.FromHsv(Matrix[i,j], 0.8, 0.8);
//pixels[i, j] = Math.Abs(this.Matrix[m - 1 - i, j]) <= this.ZeroTolerance ? OxyColors.Transparent : this.NotZeroColor;
pixels[i, j] = Math.Abs(this.Matrix[m - 1 - i, j]) <= this.ZeroTolerance ? OxyColors.Transparent : c;
}
}
this.image = OxyImage.PngFromArgb(pixels);
}
Customer support service by UserEcho