thehale commented on issue #19589: URL: https://github.com/apache/echarts/issues/19589#issuecomment-1927689230
> *splitArea.interval* has to be a fixed number ... OTOH, *bar.itemStyle.color* could be an arbitrary value. So I do not think these two can be compared. The dynamic `bar.itemStyle.color` was a visual aid to communicate my desired behavior from `splitArea.interval`. I was comparing final output on the rendered graph, not the intermediate outputs of the custom functions. Sorry if that was confusing. > If you want to color weekends, try *markArea*. I did try that, but performance plummeted for larger datasets (e.g. marking all the weekends in a chart with multiple years of data), while `splitArea` stayed snappy (though wrong). > *splitArea.interval* ... defines the alternation frequency of two colors. If that's the expected behavior, it seems like there's still a bug, since none of the charts in my minimal example had an alternation frequency that could be represented by a single number. Furthermore, if a single number is expected, I would expect echarts to invoke my callback once per axis. In reality, echarts invokes my callback for each segment along the axis (evidenced by adding a `console.log(index, value)` to the callback). Perhaps then, this ticket is not a bug report, but a feature request for more customizability of the alternation frequency of `splitArea.interval`. To me, the simplest, most flexible option would be clarifying the behavior of the current API [per the TypeScript definition](https://github.com/apache/echarts/blob/031a908fafaa57e2277b2f720087195925ec38cf/src/coord/axisCommonTypes.ts#L268-L273), specifically that a call to `(index, value) => boolean` for each axis segment determines the color of that segment's background. - The current `'auto'` could be represented by `(index, value) => index % 2` - The current `number` could be represented by `(index, value) => Math.floor(index / NUMBER) % 2`. - Full customizability can be achieved with `(index, value) => /* something custom with index and/or value */` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
