how do we plot bar chart in lightningchartjs - lightningchart

Is there a way to draw a simple bar chart on x axis and y axis like . I need a bar chart on x : 0 and height till y: 10 , then x:1 and height till y:5 like that ?
I need to share the x axis with different axis.

Related

How to rotate line chart series

I've the opportunity to plot several series in a line chart. Now I want to rotate one of them. Is there any way I can do this?
Normal:
Y axes
|
|
----X axes
What I want to get:
X axes
|
|
Y axes ----
In the end, I was helped by rotation transformation of the original tabulated function and sorting values by y, as well as changing the sorting policy for line chart:
lineChart.setAxisSortingPolicy(LineChart.SortingPolicy.NONE);
As I wanted, I got
one function along the x axis and another along the y axis

dygraphs configuring dual x axes

I have a dygraph that is plotting two sets of data. The one x-axis is 1 to 600 and the second y-axis is 1-300. How can both be plotted showing the x-axis and the 300 point plot scaled correctly. See the attached example of what I am getting. Would love to have numbers on the second y axis too.
thanksCurrent Code Example

Histogram bars exceed chart area in R

I am creating a histogram with the following line:
hist(mydata$freq2,col="lightgreen")
This produces the image below:
I would like the bars to stay within the chart area. Why doesn't R increase the values of the X and Y axis, and how can I increase these values manually?
The bars to stay in the chart area. R calculates the axis dimensions based on your data and with default parameters even extends it a bit.
The axis with its labels is drawn for the boxplot only inside the label range.
If you draw a box around the figure, you will see that the plot uses up the space always the same disregarding of your data. So it is not the bars going outside the chart but the axis being restricted to the labels.
set.seed(12345)
par(mfrow=c(2,2))
plot_random_hist <- function() {
hist(rbeta(100,1,8)*runif(1))
# plot a box to illustrate the plot area
box(col="red")
}
replicate(4, plot_random_hist() )
Have a look at par("usr") to query the dimensions of your plot in user coordinates.
If you need to control the length of the axis and the ticks/labels you can use the axis command and suppress automatic axis in your hist call.
set.seed(12345)
hist(rbeta(100,1,8),yaxt="n")
at <- c(0,10,30,par("usr")[4])
axis(2,at=at,labels=round(at))

How to set range of y axis on stacked barplot crossing the x-axis?

I have a question how to modify stacked barplot crossing the x axis presented here Stacked barplot crossing the x-axis. I want to set yaxis range from eg.-10 to 10. But when I've used ylim(-10,10) negative values appear on the left and scale_y_continuous(labels=abs) doesn't work (like in: http://i.stack.imgur.com/JwgW9.png). How to set range on yaxis and have positive values on both sides from zero?

How to add a break in X axis?

I was wondering whether it is possible to make a plot in R with x axis containing one of the shapes below indicating that x axis is not starting from zero?
How about the axis.break() from the package plotrix? For example:
library(plotrix)
plot(3:10,main="Axis break test")
# put a break at the default axis and position
axis.break()
# or at a certain position
axis.break(axis=1, breakpos=3) # on x-axis position 3

Resources