How to hide LCJS ChartXY tick labels but display grid - lightningchart

.setTickStrategy(AxisTickStrategies.Empty);
please refer the pic.

The "grid" is formed by the intersections of all Axis ticks.
If you want to hide the tick labels, but keep the grid, you can do it by hiding tick label style (text) and tick style (small tick between axis and label).
Please refer to the official documentation Numeric Ticks FAQ for tick style syntax.
In this case, VisibleTicks.setTickStyle(emptyLine).setLabelFillStyle(emptyFill) to hide these two parts.

Took me like three days to figure this out. This is set to work on a chart that has a DateTime horizontal axis, but you could tweak a little to work for two number axii. All complaining aside about why this is the way you set things like axis tick visibility:
//turning axis labels off entirely:
function disableTicks(chartObj) {
chartObj.getDefaultAxisX().setTickStrategy(AxisTickStrategies.DateTime,(ticks) =>ticks.setDateOrigin(dateOrigin).setMajorTickStyle((style)=>style.setTickStyle(emptyLine)
.setLabelFillStyle(emptyFill)
).setMinorTickStyle((style)=>style.setTickStyle(emptyLine)
.setLabelFillStyle(emptyFill)
))
chartObj.getDefaultAxisY().setTickStrategy(AxisTickStrategies.Numeric,(ticks) =>ticks.setMajorTickStyle((style)=>style.setTickStyle(emptyLine)
.setLabelFillStyle(emptyFill)
).setMinorTickStyle((style)=>style.setTickStyle(emptyLine)
.setLabelFillStyle(emptyFill)
))
}
You also need to add 'emptyFill' alongside the other declarations (or imports? I've been out of my depth for miles now) at top of your html like so:
<script src="/js/lcjs/lcjs.iife.js"></script>
<script>const { lightningChart,OHLCSeriesTypes, OHLCFigures,
AxisTickStrategies,
LegendBoxBuilders,
Themes, SolidLine, SolidFill, PointShape, ColorHEX, emptyLine, emptyTick,emptyFill } = lcjs</script>

Related

How to change asp.net chart yAxis label text?

i need to set arabic numbers on y axis for my asp.net chart, but unfortunately changing the font would not help me. So i tried to change the label text by Code, for all labels I want to change the TEXT of labels, is it possible, is there any way? please see my Chart, i want to change the circled part numbers. thanks
You may use label formatter callback function.
function Format(label, series) {
return "your arabic text";
}
HighCharts is really good for drawing charts.
http://jsfiddle.net/QQk8Z/3/

Reduce padding between axis labels and tick markers on Flex charts

I have a mx.charts.LineChart in Flex and I would like to know how to reduce the padding between the value labels and the tick markers? I've highlighted the region I mean with yellow boxes in the image below.
I'd like the labels to be as close as possible to the tick markers, just a couple of pixels will do.
I only care about applying this to the x-axis.
I'd also be interested to know how to reduce the padding between the axis title (e.g. kB and minutes on chart below) and the value labels.
Use the labelGap style of the AxisRenderer class.
By default it is 3 pixels, you can set it to 0 (or even a negative value if still not close enough).
For positioning the axis title there is no easy solution. You could write the vertical axis title yourself, as a label on top left of the chart. An advantage is that it is much better for the user to read (than the vertical writing).

Add a space between the axis and text with NVD3 charts

I tried to understand which classes were involved in the style for the axis but It didn't help me at all.
I didn't find the right class to add a margin between the axis and the text.
Could you suggest me something about it ?
In order to do this you can select the axis text and change x, y, dx, dy, text-anchor attributes accordingly, for example:
d3.select(".nv-x").selectAll(".tick text")
.attr('y', 15);

How to disable auto hiding of labels on Category Axis?

In amCharts column chart, labels on category axis are alternately hidden when user reduces the browser width.
Please refer JSFiddle in the comments (When the JSFiddle output box is dragged inwards, amCharts starts hiding alternative labels on category axis as shown in screenshot above).
How to disable auto hiding of labels on category axis? Requirement is to scale down the chart (without hiding any label), when user reduces the browser size. This issue occurs when you add more columns beyond certain count.
There is a way to increase the number of labels shown, however it won't force them to show, when they're out of the renderrange of the chart. (I've also tested forceShowField, but this doesn't work for me)So the way how you could do it is setting the minHorizontalGap to zero (or at least a lower value than default which is 75). Check docs and your modified JSFiddle.
"categoryAxis": {
"gridPosition": "start",
autoWrap:false,
minHorizontalGap:0,
}

Flex Chart Axis style: what is this style called?

I'm having difficulty with Flex charts. I'm working on a complete rewrite of a flex app that has a fair bit of charting involved, and I've been instructed to get the look and feel as close to the previous version as possible (for the initial release).
I can't seem to find the style property which dispays a blue, tabbed sort of effect of the chart axes. As I don't have the rep to post an image, I'll direct you to the adobe live docs 'using line charts' page (sorry, I can only post one link because of the anti spamming mechanism, see link in the edit below) - the effect is present on the vertical axis of the chart at the top of the line charts examples page.
It seems to be some kind of default setting, but I have not been able to pin it down, not even when copying chunks of the old code.
If anyone has any ideas as to how to get hold of this style, or as to what could be removing this style, I'd be extremely grateful.
Thanks for reading.
Edit:
Sorry I will try to clarify:
If you look at the chart at the top of the using line charts page in the Adobe Live docs, the vertical axis has a thick, blue tabbed style, but the horizontal axis does not.
I am trying to gain control over this blue tabbed style - specifically I want to make it appear on the horizontal axis and remove it from the vertical axis of a line chart. However, I cannot find the property which sets this style.
I know it is possible to alter this style, as I have seen examples of charts with the look I need, however there does not appear to be an obvious way to alter it.
I hope this is a bit clearer. Thanks.
The blue bar that comes by default is a stroke. The white divisions within it are minor ticks.
To style it differently, you need four parts:
a chart (e.g. LineChart)
an Axis (e.g. LinearAxis)
an AxisRenderer
a Stroke (e.g. SolidColorStroke)
Then you'll have to connect these parts:
var chart = new LineChart();
var vAxis = new LinearAxis();
var stroke = new SolidColorStroke();
stroke.caps = CapsStyle.NONE;
stroke.weight = 1;
stroke.color = 0x000000;
var axisRenderer = new AxisRenderer();
axisRenderer.axis = vAxis;
axisRenderer.setStyle("axisStroke", stroke);
// Only if you don't want minor ticks to display:
axisRenderer.setStyle("minorTickPlacement", "none");
chart.verticalAxis = vAxis;
chart.verticalAxisRenderers = [axisRenderer];
You'll find more on the topic here: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7c65.html
Its not enough clear for me, what do you want, but if you are looking for styling of charts look this, but if something about axis look this.
Anyway you should explain your goals, so we could help you.

Resources