how to get X and Y axis visible min and max values from Lightning Chart - lightningchart

I need to get values of visible X and Y axis from lightning chart,
I am using dashboard.createChartXy() with zoom band feature.

The active interval of an Axis can be requested with Axis.getInterval method.
const xInterval = chart.getDefaultAxisX().getInterval()
console.log(xInterval.start, xInterval.end)

Related

BIRT: Setting the scale of an axis with script

I have a chart with two Y-Axis. One Axis is only a linear line, where you can enter the start and ending point via parameter. The other one is a bar chart, which reads data from a database. My problem is, that the scale of the Y-Axis is not matching. For example the bar axis gets to 1500 at the highest point. The line axis can get higher. Therefore I want to edit the scale of the bar axis in the beforeGeneration script of the chart, so that it´s matching the line axis scale.
Its pretty simple to do that, but when I want to read the min and max of the scale, I only get a null as result.
yAxis = chart.getOrthogonalAxes( xAxis, true)[0];
yscale = yAxis.getScale();
min = yscale.getMin();
max = yscale.getMax();
Then I tried to do it with the parameter, but that is also not working. For some reason Iam not able to read the parameter in the chart script.
yAxis = chart.getOrthogonalAxes( xAxis, true)[0];
yscale = yAxis.getScale();
yscale.setMax( NumberDataElementImpl.create(params["EndwertPara"].value));
yscale.setMin( NumberDataElementImpl.create(0));
yAxis.setScale(yscale);
Error: ReferenceError: "params" is not defined. at line 37 of chart script:
Any idead how to match the scale of the two Y-Axis?

How to set the distance between axis label and axis in bokeh?

one can use p.yaxis[0].axis_label_standoff for setting the distance between y label and y thick labels.
I would like to set the distance between the y label and y axis (or y thicks). So that all plots have y labels and y axis aligned, regardless of the length of y thick labels.
There's no built-in functionality to do that. However, you can create a custom Axis class that extends one of the Bokeh's built-in ones and override its _draw_axis_label method to do what you need.

Bokeh line graph showing no y axis values

I am trying to run a line plot wit some values and and it is showing the dates on the x axis but nothing in the y axis. I tried
p.figure ( y_range=(0,8000)) and it still didn't work.
This is my code
source=ColumnDataSource(df_ora)
labels = LabelSet(x='DAY', y='LOAD', text='LOAD', level='glyph',
x_offset=5, y_offset=25, source=source, render_mode='canvas')
p = figure(title="Transmission Peak Load
Forecast",x_axis_type="datetime",y_axis_label='Load', plot_width=600,
plot_height=600)
p.line('DAY', 'LOAD', source=source,line_width=1)
p.axis.ticker=DaysTicker(days=np.arange(1,32))
p.add_layout(Title(text="Date", align="center"), "below")
p.add_layout(labels)
p.circle(x=df_ora['DAY'],y=df_ora['LOAD'],size=5)
# output_notebook()
show(p)
So now it shows the days on the bottom, the line plot with the values at the circles, but no range of values in y. I tried to Randge1d(start=0, end=8000), but it still didn't show any numbers in the y axis.
DaysTicker assumes the range values will be timestamps, i.e. milliseconds since epoch. So giving a range (0, 8000) means show the days between 0 and 8000 milliseconds on Jan 1, 1970. There are zero full days in that span.

How to Fix the X Axis values length in Microsoft chart controls

In My sample, I make the X axis to rotate to -90. Now the label values are vertical.
Some of the values are huge like "Sample Quotes".
Due to this huge values, My label area is increased and chart area is decreased.
Is it possible to fix the X axis label length in Microsoft chart controls?
I got the answer for this question.
This is possible by
MSChart.ChartAreas[0].AxisX.LabelAutoFitStyle = LabelAutoFitStyles.WordWrap;
MSChart.ChartAreas[0].AxisX.IsLabelAutoFit = true;
Regards,
Karthik

Set Asp.Net Chart tick marks to start at axis min value and end and max value

I'm using the Asp.net built in chart control to render a gantt chart and it looks like this
(source: easycaptures.com)
.
How do I get the axis labels to start from the axis min value (20.1.2012) and the last label to be at the max value (20.2.2012).
Regards,
Mathias
ChartArea.AxisY.Maximum = MAX_VAL;
ChartArea.AxisY.Minimum = MIN_VAL;

Resources