oxyplot icon indicating copy to clipboard operation
oxyplot copied to clipboard

Explicit mechanism for ignoring default ColorAxis

Open VisualMelon opened this issue 3 years ago • 2 comments

Some series support using a ColorAxis but do not require it (e.g. ScatterSeries, VectorSeries being design at the moment) or could support not having a ColorAxis (e.g. RectangleSeries).

Presently, ScatterSeries will ignore a ColorAxis if it's Color is defined and not automatic, see #271 for why this is the case (essentially the same motivation as this issue). This isn't ideal, as it means you can't use an automatically picked color. The implementation also seems to be unhappy if there is no ColorAxis at all, which shouldn't be the case.

Options:

  1. #271 suggested a sentinel value for the ColorAxisKey that would resolve to a null axis (String.Empty was considered)
  2. A new property in each applicable series to enable/disable use of DefaultColorAxis (or any ColorAxis)
  3. A new property in PlotModel to enable/disable initialisation of DefaultColorAxis
  4. A new property in IColorAxis or IAxis to enable/prevent use as a default axis

2 or 4 would be my preferred options from these; any other suggestions welcome.

VisualMelon avatar Nov 27 '22 10:11 VisualMelon

This is all made more complicated by having to know whether to call PlotModel.GetDefaultColor

VisualMelon avatar Nov 27 '22 10:11 VisualMelon

It seems that there is also a problem when there is a defined color axis and the color (markerfill in this case) is set. See #2078

Spordoz avatar May 01 '24 14:05 Spordoz