Closed kedu closed 1 year ago
设置max成0.1的时候,会崩溃,在 AAJsonConverter里的dictionaryWithObjectInstance的 id value = [objc valueForKey:propName];,麻烦看一下
能不能帮忙看一下
这段 js 代码:
//Highcharts.chart("chart", {
// chart: {
// type: "line",
// height: 300,
// },
// credits: {
// enabled: false
// },
// legend: {
// enabled: false
// },
// title: {
// text: "Chart"
// },
// yAxis: [{
// endOnTick: false,
// max: 0.1,
// title: {
// text: "Negative values make me sad"
// }
// }],
// series: [{
// data: [0, 0, 0, -2, -2, -1, 0, -2], // If you put a `1` value in and then everything renders nicely.
// lineWidth: 8
// }]
//});
对应的 OC 代码为:
- (AAOptions *)toFixHighchartsWithAThickLineAt0ValuesTheLineIsHalfHidden {
return AAOptions.new
.chartSet(AAChart.new
.typeSet(AAChartTypeLine)
)
.creditsSet(AACredits.new
.enabledSet(false))
.legendSet(AALegend.new
.enabledSet(false))
.titleSet(AATitle.new
.textSet(@"Chart"))
.yAxisSet((id)@[
AAYAxis.new
.endOnTickSet(false)
.maxSet(@0.1)
.titleSet(AAAxisTitle .new
.textSet(@"Negative values make me sad")),
])
.seriesSet(@[
AASeriesElement.new
.dataSet(@[@0, @0, @0, @-2, @-2, @-1, @0, @-2])
.lineWidthSet(@8),
]);
}
更简洁的写法:
- (AAOptions *)toFixHighchartsWithAThickLineAt0ValuesTheLineIsHalfHidden {
return AAOptions.new
.chartSet(AAChart.new
.typeSet(AAChartTypeLine))
.creditsSet(AACredits.new
.enabledSet(false))
.legendSet(AALegend.new
.enabledSet(false))
.titleSet(AATitle.new
.textSet(@"Chart"))
.yAxisSet(AAYAxis.new
.endOnTickSet(false)
.maxSet(@0.1)
.titleSet(AAAxisTitle .new
.textSet(@"Negative values make me sad")))
.seriesSet(@[
AASeriesElement.new
.dataSet(@[@0, @0, @0, @-2, @-2, @-1, @0, @-2])
.lineWidthSet(@8),
]);
}
设置max成0.1的时候,会崩溃,在 AAJsonConverter里的dictionaryWithObjectInstance的 id value = [objc valueForKey:propName];,麻烦看一下
如果你的崩溃是由 yAxisSet
方法的参数类型不匹配引起的, 改为这个简洁的写法应该就可以了.
当边界是0,线也在0,被切了一半,变细了。希望不要被切