series[0]->AddXY(30,10,'label1',clRed);
series[0]->parent = chart;
This is my code to print 1 series on chart.
Now I am getting label1 printed on X axis.
Is there any way to print this label on Yaxis.
You should set left axis LabelStyle to talText, for example:
Chart1->Axes->Left->LabelStyle = talText;
Related
I need to interpolate two variables written in the 3D grid on another 3D grid. I tried the inverse distance method, but I get only two values that do not represent the distribution on the original grid, assigned to each point of the new grid. Here is an example of my code:
text=text[pstart:pend]
x=[]
y=[]
z=[]
for line in text:
coords=line.split()
x.append(float(coords[2])) #coordinates of the new grid
y.append(float(coords[1]))
z.append(float(coords[0]))
Xg=np.asarray([x,y,z])
# Gather mean flow data
xd=[]
yd=[]
zd=[]
cd=[]
rhod=[]
with open(meanflowdata,'rb') as csvfile:
spamreader=csv.reader(csvfile, delimiter=',')
for row in spamreader:
if len(row)>2:
xd.append(float(row[0])) #coordinates and values of the source file
yd.append(float(row[1]))
zd.append(float(row[2]))
cd.append(float(row[3]))
rhod.append(float(row[4]))
Xd=np.asarray([xd,yd,zd])
Zd=np.asarray([cd,rhod])
leafsize = 20
print "# setting up KDtree"
invdisttree = Invdisttree( Xd.T, Zd.T, leafsize=leafsize, stat=1 )
print "# Performing interpolation"
interpol = invdisttree( Xg.T )
c=interpol.T[0]
rho=interpol.T[1]
As far as I could check, the problem lies when I call the invdisttree function, which does not work properly. Does someone have an idea or an alternative method to suggest for the interpolation?
Where do interpol.T[0], interpol.T[1] come from,
where did your Invdisttree come from ?
This
on SO has
invdisttree = Invdisttree( X, z ) -- data points, values
interpol = invdisttree( q, nnear=3, eps=0, p=1, weights=None, stat=0 )
In your case X could be 100 x 3, z 100 x 2,
query points q 10 x 3 ⟶ interpol 10 x 2.
(invdisttree is a function, which you call to do the interpolation:
interpol = invdisttree( q ...) . Is that confusing ?)
I am using dygraphs for R and I opened the following issue on GitHub the other day, however, I have not yet received an answer. Therefore, I am hoping someone in here will be able to answer my question.
I want to know if it is possible to show all the values of the prediction interval in the legend, i.e. , lower, actual, upper, without having them as three separate plain dySeries? I like the look of the shading that the upper/lower bars bring, but I would also like to be able to hover over a point and see all the values for that particular point, not just the middle one. If such a function does not exists, is there an easy workaround, maybe with fillGraph = TRUE or something?
library(dygraphs)
hw <- HoltWinters(ldeaths)
p <- predict(hw, n.ahead = 72, prediction.interval = TRUE)
dygraph(p, main = "Predicted Lung Deaths (UK)") %>%
dySeries(c("lwr", "fit", "upr"), label = "Deaths")
The preceding code is the example from the web page, which is similar to my problem. I simply want to see the lwr and upr values in the legend when hovering.
So I found a workaround for anybody looking for something similar.
library(dygraphs)
hw <- HoltWinters(ldeaths)
p <- predict(hw, n.ahead = 72, prediction.interval = TRUE)
max <- p[,2]
min <- p[,3]
p <- ts.union(p, max, min)
dygraph(p, main = "Predicted Lung Deaths (UK)") %>%
dySeries(c("p.lwr", "p.fit", "p.upr"), label = "Deaths") %>%
dySeries("max", label = "Max", pointSize = 0.01, strokeWidth = 0.001) %>%
dySeries("min", label = "Max", pointSize = 0.01, strokeWidth = 0.001)
Obviously, this can be modified to suit your needs (e.g. color of the points etc.) The main idea in this method is simply to create two new columns containing the same information that is used in the bands, and then to make the lines to these too small to see.
I am trying to show multi line graph for showing profit/loss . I am able to plot graph.
var niftyProfit = [];
var niftyProfitChartData = [];
var sum = 0;
data.forEach(function(obj) {
niftyProfit.push(obj.profit);
});
for (var i in niftyProfit) {
sum = sum + niftyProfit[i];
niftyProfitChartData.push(sum);
}
obj.profit is the p/l column data. I want to populate the value, which I did in for loop for eg. consider profit = [4,2,-3,-5], then my final array to populate in chart would become [4,6,3,-2]. I ploted data on chart which is array niftyProfitChartData , now In tooltip on hover its showing data from niftyProfitChartData .But I want to show data from niftyProfit array in tooltip . Here is Fiddle Link of what i tried till now .
http://jsfiddle.net/zkrh7/159/
I used multi directional scrolling with a custom flow layout in a UICollectionView to create a numeric table.
The structure of the table should be like this. A numeric table which has the sum up value in the last row:
Now the first column and the first row of the table is static i.e sticky. I want the last row also to get Sticked at the bottom of the view. Kindly help me.
This is my current view of the table:
Thank You in advance.
if section == sectionCount-1 {
for item in 0...rowCount-1 {
let indexPath = IndexPath(item: item, section: section)
if let attrs = cellAttrsDictionary[indexPath] {
var frame = attrs.frame
if item == 0 {
// Assigning the size of the first column as 200
frame.size.width = 200
frame.origin.x = xOffset
}
// Configuration for the last row in the last cell.
// Subtracting the Cell height from the entire Collection View height and assigning it as the frame for the last row of the Table i.e precisely on Y position.
frame.origin.y = (collectionView?.frame.size.height)! + yOffset - CGFloat(CELL_HEIGHT)
attrs.frame = frame
}
}
}
I have seen a lot of answers to this type of question but I have still not found a solution. This is my bar chart:
All I would like is to be able to set the y axis scale to display from a negative number, and for the the labels not to overlap the chart.
I have the following options:
var options = {
barValueSpacing : 5,
barDatasetSpacing : 0,
scaleBeginAtZero: false
}
but it doesn't set the starting point as -2, I am not sure why.
Have looked at https://jsfiddle.net/1fkc5jt7/ which does exactly what I want but it does not work on my chart for some reason.
You are missing a ,
var options = {
barValueSpacing : 5,
**barDatasetSpacing : 0,**
scaleBeginAtZero: false
};