SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
hi everyone
when i use utf8 string such as ‘محور’ = axis in persian sciChart lookLike this .
i tried different fonts but did not work .
SciChartBuilder.init(this@Main2Activity)
// 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()
.withDataSeries(dataSeries)
.withStrokeStyle(ColorUtil.White, 3f, false)
.build()
surface.chartModifiers.add(sciChartBuilder.newModifierGroupWithDefaultModifiers().build())
UpdateSuspender.using(surface) {
Collections.addAll<IAxis>(surface.xAxes, xAxis)
Collections.addAll<IAxis>(surface.yAxes, yAxis)
Collections.addAll<FastColumnRenderableSeries>(surface.renderableSeries, rs)
}
and the result :
Hi Darius,
Actually we do support UTF-8 symbols but for now there is no support of RTL text in axis title. That’s why text is rendered incorrectly. I’ve created a task in our bug tracker to fix it.
This should be fixed starting from 2.2.2.2424 which you can get from our Maven repository.
Best regards,
Yura
Please login first to submit.