Skip to content

Commit 8e43103

Browse files
committed
Merge remote-tracking branch 'origin/simon' into main
2 parents 4593845 + 5e26dc5 commit 8e43103

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
- Parts of markers outside of plot area are getting clipped. This behaviour can
99
be controlled by style.plot.overflow parameter.
10+
- channel title parameter has "auto" value by default. "null" will title switch
11+
off.
1012

1113
### Fixed
1214

src/apps/weblib/js-api/vizzu.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ interface ChannelRange {
113113
axis or legend. */
114114
interface Channel {
115115
/** This title is shown on the axis or legend corresponding to the channel.
116-
If not specified, the title will be the name of the measure attached to
116+
If 'auto', the title will be the name of the measure attached to
117117
that channel. */
118-
title?: string|null;
118+
title?: string|'auto'|null;
119119
/** List of {@link Data.Series.name|data series names} on the
120120
channel. */
121121
set? : Data.SeriesList|null;

src/chart/generator/diagram.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,10 @@ Axis Diagram::calcAxis(ScaleId type, const Data::DataTable &dataTable)
247247
if (!scale.isEmpty() && !scale.isPseudoDiscrete())
248248
{
249249
auto title =
250-
scale.title.get().empty()
250+
scale.title.get() == "auto"
251251
? scale.continousName(dataTable)
252+
: scale.title.get() == "null"
253+
? std::string()
252254
: scale.title.get();
253255

254256
if (type == options->subAxisType()
@@ -278,7 +280,10 @@ void Diagram::calcDiscreteAxis(ScaleId type,
278280

279281
if (scale.discretesIds().empty() || !scale.isPseudoDiscrete()) return;
280282

281-
axis.title = scale.title.get();
283+
axis.title =
284+
scale.title.get() == "auto" || scale.title.get() == "null"
285+
? std::string()
286+
: scale.title.get();
282287

283288
if (type == ScaleId::x || type == ScaleId::y)
284289
{

src/chart/options/scale.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void Scale::reset()
102102
{
103103
continousId = std::nullopt;
104104
discretesIds->clear();
105-
title.set(std::string());
105+
title.set("auto");
106106
labelLevel.set(0);
107107
}
108108

0 commit comments

Comments
 (0)