MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / LabelAxisValue

Function LabelAxisValue

Source/3rdParty/implot/implot.cpp:1637–1653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1635}
1636
1637void LabelAxisValue(const ImPlotAxis& axis, double value, char* buff, int size, bool round) {
1638 ImPlotContext& gp = *GImPlot;
1639 // TODO: We shouldn't explicitly check that the axis is Time here. Ideally,
1640 // Formatter_Time would handle the formatting for us, but the code below
1641 // needs additional arguments which are not currently available in ImPlotFormatter
1642 if (axis.Locator == Locator_Time) {
1643 ImPlotTimeUnit unit = axis.Vertical
1644 ? GetUnitForRange(axis.Range.Size() / (gp.CurrentPlot->PlotRect.GetHeight() / 100)) // TODO: magic value!
1645 : GetUnitForRange(axis.Range.Size() / (gp.CurrentPlot->PlotRect.GetWidth() / 100)); // TODO: magic value!
1646 FormatDateTime(ImPlotTime::FromDouble(value), buff, size, GetDateTimeFmt(TimeFormatMouseCursor, unit));
1647 }
1648 else {
1649 if (round)
1650 value = RoundAxisValue(axis, value);
1651 axis.Formatter(value, buff, size, axis.FormatterData);
1652 }
1653}
1654
1655void UpdateAxisColors(ImPlotAxis& axis) {
1656 const ImVec4 col_grid = GetStyleColorVec4(ImPlotCol_AxisGrid);

Callers 3

EndPlotFunction · 0.85
AnnotationFunction · 0.85
TagFunction · 0.85

Calls 7

GetUnitForRangeFunction · 0.85
FormatDateTimeFunction · 0.85
GetDateTimeFmtFunction · 0.85
RoundAxisValueFunction · 0.85
SizeMethod · 0.65
GetHeightMethod · 0.45
GetWidthMethod · 0.45

Tested by

no test coverage detected