Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#10897 closed enhancement (fixed)

[patch][ccla]Allow a combination of theme-based and custom styles to be used

Reported by: Adam Peller Owned by: Eugene Lazutkin
Priority: high Milestone: 1.5
Component: Charting Version: 1.4.0
Keywords: Cc: deanw, dave.clark@…
Blocked By: Blocking:

Description (last modified by Adam Peller)

A theme can be supplied to a chart, supplying stroke and fill styles, an array of colors to use for successive data series, and an array of marker shapes to use for successive data series. It is also possible to supply a specific stroke, or fill, for an individual data series. However, if this is done, any attributes of the stroke or fill which are omitted from the per-series stroke or fill revert to the default values, not the values from any supplied theme. For example, a particular series might specify stroke: { width: 3.0 } to request a thicker line, but this currently causes any line color which was supplied from a theme to be abandoned and a default (black) to be used. It would be more logical for attributes which are omitted from a per-series stroke/fill style to revert to the values supplied by the chart theme, thereby allowing per-series style settings to "override" the theme values, rather than having to fully restate the theme values that are not to be changed. This is particularly important for colors, where the theme can supply a set of colors which are applied in turn, and attempting to replicate this in per-series style settings is difficult and error-prone.

See test case in #10898

Attachments (1)

100324-style.patch (2.0 KB) - added by Adam Peller 10 years ago.
patch from Dave Clark (IBM, CCLA)

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by Adam Peller

Attachment: 100324-style.patch added

patch from Dave Clark (IBM, CCLA)

comment:1 Changed 10 years ago by Adam Peller

Description: modified (diff)

comment:2 Changed 10 years ago by Eugene Lazutkin

Status: newassigned

comment:3 Changed 10 years ago by Eugene Lazutkin

While the idea is good, it is implemented only for one plot (the default), leaving the behavior inconsistent. We need to implement this functionality across all plots, otherwise we will have a documentation nightmare and mass user's confusion.

Another thing is what to do with fills. Probably we need to be smart about that too and augment fills of the same type, while reverting to complete replacement for incompatible types.

comment:4 Changed 10 years ago by Adam Peller

Cc: deanw dave.clark@… added

comment:5 Changed 10 years ago by Eugene Lazutkin

Resolution: fixed
Status: assignedclosed

(In [21836]) Refactored charting themes, !strict, refs #8866, fixes #8868, fixes #10897, refs #10938.

comment:6 Changed 10 years ago by Eugene Lazutkin

Type: defectenhancement

Major changes to visual properties:

  • They are merged now instead of being replaced as Dave Clark proposed.
  • The merge order:
    1. Default theme.
    2. Custom theme.
    3. Plot options.
    4. Series options.
    5. Value object.
  • All plots are covered uniformly.
Note: See TracTickets for help on using tickets.