Replies: 2 comments 3 replies
-
Hey,
The line colour is actually set via 'strokeColor' (not 'lineColor') following the default JavaFX attribute styles.
You can find a list of globally known definitions in XYChartCss though certain renderers may locally define additional ones. The various definitions for the default DataSet colours are defined in the DefaultRenderColorScheme and can be further customised to your liking. The LabelledMarkerSample illustrates the various line and marker styles.
The legend should follow the above definitions. You may need to 'nudge' and request to repaint the chart in case you have dynamically changed the style (for quick test resizing should also work). The interfaces in There are some additional samples here that may be useful to explore the various options. Hope this helps... if you still are having some problem please feel free to copy-paste a short MVP example and we can go through this together. Out of curiosity: may we ask the domain you are using our little lib? |
Beta Was this translation helpful? Give feedback.
-
Trying for hours just to set the markerColor for the circle2 marker to red, but it always defaults somehow to blue. |
Beta Was this translation helpful? Give feedback.
-
My goal here is to create a scatter plot with two series and for each of those series I will also add an additional series which is a guassian fit. The gaussian fit should be visible as a line with no markers.
As far as colors go, I'm completely fine with the default. However, my attempts to change the line and marker settings seem to have an odd effect on the colors, as you'll see below.
I use a dark .css for my javafx app, which explains why most colors are inverted in the images below. This should be unrelated to the issue.
To start, here's my initial chart. It uses two

DoubleDataSet
s twoDefaultNumericAxis
s and anXYChart
. Most of what you are seeing here are default settings:In order to change line and marker settings, my search has lead me to beleive that
ErrorDataSetRenderer
is the proper way. But please correct me if I'm wrong. Applying the (kotlin) code below:changes the plot to look like:

Here you can see the color issue I mentioned above. The default colors for the lines have changed to shades of grey, and also the legend is now displaying the wrong colors.
Next I tried changing from lines to markers with custom colors. I tried:
Expectation: a chart with no lines, green markers, and a legend that matches the markers.
Actual result: a chart with visible lines, green markers, and a legend that matches the lins instead of the markers.
I also tried adding
lineColor=transparent
to the style to make the lines go away, but this didn't work.So my questions for now are:
Beta Was this translation helpful? Give feedback.
All reactions