mirror of
https://github.com/klinecharts/KLineChart.git
synced 2024-11-25 16:22:43 +08:00
opt: opt axis display
This commit is contained in:
parent
c80f5cfea1
commit
5086d071b8
@ -42,15 +42,15 @@ export default abstract class XAxisImp extends AxisImp {
|
||||
let text = ''
|
||||
switch (weight) {
|
||||
case TimeWeightConstants.Year: {
|
||||
text = dateTime.YYYY
|
||||
text = dateTime.YYYY + '年'
|
||||
break
|
||||
}
|
||||
case TimeWeightConstants.Month: {
|
||||
text = `${dateTime.YYYY}-${dateTime.MM}`
|
||||
text = `${dateTime.YYYY}年${dateTime.MM}月`
|
||||
break
|
||||
}
|
||||
case TimeWeightConstants.Day: {
|
||||
text = `${dateTime.MM}-${dateTime.DD}`
|
||||
text = `${dateTime.MM}月${dateTime.DD}日`
|
||||
break
|
||||
}
|
||||
case TimeWeightConstants.Hour:
|
||||
|
@ -252,7 +252,7 @@ export default abstract class YAxisImp extends AxisImp implements YAxis {
|
||||
const ticks: AxisTick[] = []
|
||||
|
||||
if (realRange >= 0) {
|
||||
const interval = nice(realRange / 8.0)
|
||||
const interval = nice(realRange / 10)
|
||||
const precision = getPrecision(interval)
|
||||
|
||||
const first = round(Math.ceil(realFrom / interval) * interval, precision)
|
||||
|
@ -160,10 +160,10 @@ export default class TimeScaleStore {
|
||||
this._gapBarSpace = Math.max(1, gapBarSpace)
|
||||
}
|
||||
|
||||
classifyTimeTicks (newDataList: KLineData[], update?: boolean): void {
|
||||
classifyTimeTicks (newDataList: KLineData[], isUpdate?: boolean): void {
|
||||
let baseDataIndex = 0
|
||||
let prevKLineData: Nullable<KLineData> = null
|
||||
if (update ?? false) {
|
||||
if (isUpdate ?? false) {
|
||||
const dataList = this._chartStore.getDataList()
|
||||
baseDataIndex = dataList.length
|
||||
prevKLineData = dataList[baseDataIndex - 1]
|
||||
@ -300,7 +300,7 @@ export default class TimeScaleStore {
|
||||
this._chartStore.getActionStore().execute(ActionType.OnVisibleRangeChange, this._visibleRange)
|
||||
this._chartStore.adjustVisibleDataList()
|
||||
if (
|
||||
this._cacheVisibleRange.from !== this._visibleRange.from &&
|
||||
this._cacheVisibleRange.from !== this._visibleRange.from ||
|
||||
this._cacheVisibleRange.to !== this._visibleRange.to
|
||||
) {
|
||||
this._cacheVisibleRange = { ...this._visibleRange }
|
||||
|
Loading…
Reference in New Issue
Block a user