- changed status to resolved
Encapsulate common chart "recipes" in reusable form
Issue #877
resolved
The RowColChart component sets up the chart according to more than a dozen input bindings. For tweaking of the chart beyond these basic setups, we can use the onRenderChart
callback to modify the echart option
object before it is rendered.
Modifying the option
requires a good knowledge of the structure of this object; and experience shows that a number of common patterns tend to re-occur.
The new ChartOps
class provides methods to act on a higher level on the option
object, to achieve more “macro-level” outcomes.
ChartOpts
has a fluent interface so methods can be chained. Create the ChartOps
using the static chartOps
function:
public onChartRender(option, echarts, renderedType) {
Sw.Charts.chartOps(option)
.showLegend(renderedType != "pie" && (option.series.count > 1))
.showPieLabels(renderedType == "pie")
.minimalInk()
.lookups(this.lookups)
.translateLabels("authorities");
}
Comments (1)
-
reporter - Log in to comment
feat(charts): ChartOps class encapsultes common chart 'recipes'
Resolves
#877→ <<cset c399baaf3221>>