Skip to content

Commit

Permalink
Fixed set/get for tooltip marker id.
Browse files Browse the repository at this point in the history
  • Loading branch information
simzer committed Jun 19, 2022
1 parent 77bd871 commit 897d16a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/chart/options/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,14 @@ Config::Accessors Config::initAccessors()

res.insert({ "tooltip", {
.get = [](const Options &options) {
return Conv::toString(options.tooltipId.get());
auto id = options.tooltipId.get();
return id == Options::nullMarkerId
? std::string("null") : Conv::toString(id);
},
.set = [](OptionsSetter &setter, const std::string &value)
{
if (value == "null")
setter.showTooltip(-1);
setter.showTooltip(Options::nullMarkerId);
else
setter.showTooltip(Conv::parse<int>(value));
}
Expand Down

0 comments on commit 897d16a

Please sign in to comment.