SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components
Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!
Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.
Hello again! 🙂
This time I am trying to draw marker for a maximum numeric data value in chart with CategoryDateTime X axis.
I have my X axis defined like this:
id<SCIAxis2D> xAxis = [[SCICategoryDateTimeAxis alloc] init];
and I am trying to draw a marker in draw() method of a custom modifier using this code:
id<SCIRenderPassData> data = [_rSeries currentRenderPassData]; id<SCICoordinateCalculator> xCalc = [data xCoordinateCalculator]; id<SCICoordinateCalculator> yCalc = [data yCoordinateCalculator]; NSLog(@"Is category calc: %d", [xCalc isCategoryAxisCalculator]); double xCoord = [xCalc getCoordinateFromDate:_xValue]; double yCoord = [yCalc getCoordinateFrom:_yValue]; [_marker drawToContext:context AtX:xCoord Y:yCoord];
My _xValue is computed and set from outside and is for sure is a valid date on X axis for which I need to draw the marker on.
My problem is that:
My questions are:
Looking forward to your always useful reply. 🙂
I am using a SciStockChart and trying to add Trade Markers as outlined here https://www.scichart.com/annotations-adding-trade-markers-to-a-chart/. However, I am not getting a proper xCoordinate from the coordinate calculator. I believe SciStockChart is using a CategoryCoordinateCalculator and I must do an extra step in order to get the proper result from the DateTime input. Here is the line that is not working correctly. double xCoord = xCoordCalculator.GetCoordinate(trade.ExecutionTime.Value); Is there another step I need to take in order to get the proper xCoord value?