SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components

0 votes

hi everyone
when i use utf8 string such as ‘محور’ = axis in persian sciChart lookLike this .
i tried different fonts but did not work .


    // Obtain the SciChartBuilder instance
    val sciChartBuilder = SciChartBuilder.instance()

    val myCustomFont: Typeface? = ResourcesCompat.getFont(this, R.font.maryam)
    val fontStyle = FontStyle(myCustomFont, 50f, Color.RED)

    val s = String("محور".toByteArray(Charsets.UTF_8))

    xAxis = sciChartBuilder.newNumericAxis().withAxisTitleStyle(fontStyle).withAxisTitle(s).withGrowBy(DoubleRange(0.1, 0.1)).build()
    yAxis = sciChartBuilder.newNumericAxis().withAxisTitle("this is y").withGrowBy(DoubleRange(0.1, 0.1)).build()

    val dataSeries = XyDataSeries(Double::class.javaObjectType, Double::class.javaObjectType)
    dataSeries.append(arrayOf(0.0, 2.0, 4.0, 6.0, 8.0, 10.0), arrayOf(1.0, 5.0, -5.0, -10.0, 10.0, 3.0))

    rs = sciChartBuilder.newColumnSeries()
            .withStrokeStyle(ColorUtil.White, 3f, false)


    UpdateSuspender.using(surface) {
        Collections.addAll<IAxis>(surface.xAxes, xAxis)
        Collections.addAll<IAxis>(surface.yAxes, yAxis)
        Collections.addAll<FastColumnRenderableSeries>(surface.renderableSeries, rs)


and the result :

result image

Showing 1 result
This template supports the sidebar's widgets. Add one or use Full Width layout.