Closed yzgt closed 2 months ago
Hello @yzgt, Could we please continue our communication in English for clarity?
You can explore various chart types, including pie charts, bubble charts, and tree maps, on our demo page. Feel free to share any further suggestions or questions you may have.
I want to implement a rectangular tree diagram as shown in the above figure, where clicking on a piece of data displays a floating window and allows for custom UI layout to be passed in. How can I achieve this?
@yzgt The example you provided is essentially a tree map with a Tooltip.
If you want to customize the tooltip, you can find all the properties in the linked documentation. Below, I’ve also included an example of how to style a tooltip, incorporating styles via HICSSObject
and formatter
:
val tooltip = HITooltip()
//general formatting
tooltip.borderWidth = 2
tooltip.borderColor = HIColor.initWithName("red")
//styling
val tooltipStyle = HICSSObject()
tooltipStyle.fontSize = "12px"
tooltipStyle.fontWeight = "bold"
tooltipStyle.color = "red"
tooltip.style = tooltipStyle
//text formatting, two lines
tooltip.formatter = HIFunction(HIFunctionInterface { f: HIChartContext ->
val txt =
f.getProperty("series.name").toString() + "<br>" + "Value: " + f.getProperty("x")
txt
}, arrayOf("series.name", "x"))
options.tooltip = tooltip
Closing due to inactivity. Please feel free to reopen the ticket if you have any further questions.
好像只有线图,柱状图, 其他图的实现方式都没有吗?这个demo案例太少了, 希望增加扇形图, 气泡图, 树图