highcharts / highcharts-android

Android wrapper for Highcharts usage
Other
126 stars 30 forks source link

安卓的demo演示案例太少了 #283

Closed yzgt closed 2 months ago

yzgt commented 3 months ago

好像只有线图,柱状图, 其他图的实现方式都没有吗?这个demo案例太少了, 希望增加扇形图, 气泡图, 树图

MikolajMichalczak commented 3 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.

yzgt commented 3 months ago

微信图片_20240702101622

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?

MikolajMichalczak commented 3 months ago

@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
MikolajMichalczak commented 2 months ago

Closing due to inactivity. Please feel free to reopen the ticket if you have any further questions.