Closed serzhiio closed 5 years ago
I guess this is what you are looking for. https://docs.rs/plotters/0.2.7/plotters/chart/struct.DualCoordChartContext.html#method.secondary_plotting_area
Why secondary? And how to extract pixel coordinates?
Oh, I see, I misunderstood what you are trying to do. You should be able to strip the attached coordinate by using code like that.
chart.plotting_area().strip_coord_spec()
https://docs.rs/plotters/0.2.7/plotters/drawing/struct.DrawingArea.html#method.strip_coord_spec
Is it possible to draw series on the chart using pixel coordinates? I mean LineSeries?
Not for now. But I think this may be something worth to add.
draw_series
is almost the same as
series.for_each(|element| area.draw(element))
But if you want to add series annotation for series drawn in this way, it seems very tricky.
But an API like draw_pixel_coord_series
which provides ability for further annotation seems a nice idea.
I don't know if this is what you are asking for ?
Here is what i looked for:
let (_, order_y) = price_chart.backend_coord(&(from, (max+min)/2.0));
Lets say i have chart with given coordinate system. I need to draw a dotted (horizontal) line through whole chart using one y-coord. And i want every dot to be 5px length. What is most efficient way?