@@ -247,16 +247,22 @@ class Events
247247 struct Marker : Element
248248 {
249249 const Gen::Marker ▮
250+ struct DataPosition
251+ {
252+ Geom::Point top;
253+ } position;
250254
251- explicit Marker (const Gen::Marker &marker) :
255+ explicit Marker (const Gen::Marker &marker,
256+ const DataPosition &position) :
252257 Element(" plot-marker" ),
253- marker(marker)
258+ marker(marker),
259+ position(position)
254260 {}
255261
256262 void appendToJSON (Conv::JSONObj &&jsonObj) const override
257263 {
258- Element::appendToJSON (
259- marker. appendToJSON ( std::move (jsonObj)));
264+ Element::appendToJSON (marker. appendToJSON (
265+ std::move (jsonObj))( " position " , position ));
260266 }
261267 };
262268
@@ -268,8 +274,10 @@ class Events
268274 {
269275 bool horizontal;
270276
271- MarkerGuide (const Gen::Marker &marker, bool horizontal) :
272- MarkerChild (" guide" , marker),
277+ MarkerGuide (const Gen::Marker &marker,
278+ const Marker::DataPosition &position,
279+ bool horizontal) :
280+ MarkerChild (" guide" , marker, position),
273281 horizontal (horizontal)
274282 {}
275283
@@ -313,15 +321,19 @@ class Events
313321 return std::make_unique<Legend>(properties);
314322 }
315323
316- static auto marker (const Gen::Marker &marker)
324+ static auto marker (const Gen::Marker &marker,
325+ const Marker::DataPosition &position)
317326 {
318- return std::make_unique<Marker>(marker);
327+ return std::make_unique<Marker>(marker, position );
319328 }
320329
321330 static auto markerGuide (const Gen::Marker &marker,
331+ const Marker::DataPosition &position,
322332 bool horizontal)
323333 {
324- return std::make_unique<MarkerGuide>(marker, horizontal);
334+ return std::make_unique<MarkerGuide>(marker,
335+ position,
336+ horizontal);
325337 }
326338
327339 static auto root ()
@@ -362,11 +374,13 @@ class Events
362374 }
363375
364376 static auto markerLabel (const std::string &label,
365- const Gen::Marker &marker)
377+ const Gen::Marker &marker,
378+ const Marker::DataPosition &position)
366379 {
367380 return std::make_unique<Text<MarkerChild>>(label,
368381 " label" ,
369- marker);
382+ marker,
383+ position);
370384 }
371385
372386 static auto dimLegendLabel (
0 commit comments