Reputation: 1145
I am adding custom tick like below
axisX3.addCustomTick()
.setGridStrokeLength(0)
.setTextFormatter(()=> ttstr[0]+":"+ttstr[1])
.setValue(xVal);
I tried
.setTitleFont(f => f
.setSize(24)
)
But not working
Upvotes: 0
Views: 226
Reputation: 2620
You can edit the visual style of the created tick with customTick.setMarker()
method. This method takes a mutator function as the first and only argument.
To change the font size:
const tick = axisX.addCustomTick()
.setMarker(marker => marker
.setFont(font => font
.setSize(40)
)
)
To style the border:
const tick = axisX.addCustomTick()
.setMarker(marker => marker
.setBackground(background => background
.setStrokeStyle((line) => line
.setFillStyle(style => style
.setColor(ColorHEX('#f00'))
)
)
)
)
Showing just the pointer is not possible.
See below for a snippet of styling the tick.
const {
lightningChart,
emptyLine,
ColorHEX,
} = lcjs
const chart = lightningChart().ChartXY()
const axisX = chart.getDefaultAxisX()
const tick = axisX.addCustomTick()
.setMarker(marker => marker
.setFont(font => font
.setSize(40)
)
.setBackground(background => background
.setStrokeStyle((line) => line
.setFillStyle(style => style
.setColor(ColorHEX('#f00'))
)
)
)
)
.setValue(4)
<script src="https://unpkg.com/@arction/[email protected]/dist/lcjs.iife.js"></script>
Upvotes: 4