@@ -247,16 +247,23 @@ class Events
247247 struct Marker : Element
248248 {
249249 const Gen::Marker ▮
250+ struct DataPosition
251+ {
252+ Geom::Point top;
253+ Geom::Point center;
254+ } position;
250255
251- explicit Marker (const Gen::Marker &marker) :
256+ explicit Marker (const Gen::Marker &marker,
257+ const DataPosition &position) :
252258 Element(" plot-marker" ),
253- marker(marker)
259+ marker(marker),
260+ position(position)
254261 {}
255262
256263 void appendToJSON (Conv::JSONObj &&jsonObj) const override
257264 {
258- Element::appendToJSON (
259- marker. appendToJSON ( std::move (jsonObj)));
265+ Element::appendToJSON (marker. appendToJSON (
266+ std::move (jsonObj))( " position " , position ));
260267 }
261268 };
262269
@@ -268,8 +275,10 @@ class Events
268275 {
269276 bool horizontal;
270277
271- MarkerGuide (const Gen::Marker &marker, bool horizontal) :
272- MarkerChild (" guide" , marker),
278+ MarkerGuide (const Gen::Marker &marker,
279+ const Marker::DataPosition &position,
280+ bool horizontal) :
281+ MarkerChild (" guide" , marker, position),
273282 horizontal (horizontal)
274283 {}
275284
@@ -313,15 +322,19 @@ class Events
313322 return std::make_unique<Legend>(properties);
314323 }
315324
316- static auto marker (const Gen::Marker &marker)
325+ static auto marker (const Gen::Marker &marker,
326+ const Marker::DataPosition &position)
317327 {
318- return std::make_unique<Marker>(marker);
328+ return std::make_unique<Marker>(marker, position );
319329 }
320330
321331 static auto markerGuide (const Gen::Marker &marker,
332+ const Marker::DataPosition &position,
322333 bool horizontal)
323334 {
324- return std::make_unique<MarkerGuide>(marker, horizontal);
335+ return std::make_unique<MarkerGuide>(marker,
336+ position,
337+ horizontal);
325338 }
326339
327340 static auto root ()
@@ -362,11 +375,13 @@ class Events
362375 }
363376
364377 static auto markerLabel (const std::string &label,
365- const Gen::Marker &marker)
378+ const Gen::Marker &marker,
379+ const Marker::DataPosition &position)
366380 {
367381 return std::make_unique<Text<MarkerChild>>(label,
368382 " label" ,
369- marker);
383+ marker,
384+ position);
370385 }
371386
372387 static auto dimLegendLabel (
0 commit comments