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 :
- darius fathi asked 5 years ago
- last active 5 years ago