All,Flot co-ordinates - asp.net

I am new to Flot.
I want to show weekly visitors statistics in my projects.
I have to sho the visitors of the month but weekly on Flot.
e.g.
1st week 1-5 there are 500 visitors.
6-12 there are 900 visitors.
and so on.
And I want to show X coordinates as 1-5,6-12,13-19,....
Can anyone suggest what to do.
Strictly use Flot.

Check out the tickFormatter:
Alternatively, for ultimate control over how ticks look like you can
provide a function to "tickFormatter". The function is passed two
parameters, the tick value and an "axis" object with information, and
should return a string.
So what you're looking for is something like this:
$.plot(placeholder, data, {
//your options here
xaxis: {
tickFormatter: function(val,axis){
return (val+1).toString()+'-'+(val+5).toString();
}
}
});

I think you just want a plain old bar graph but are getting misled by the fact that you have some date-related data.
In the data you give Flot to graph, use fake numbers as x values that are just increasing integers. So for 1-5 put 0, for 6-12 put 1, and so on.
Then as Ryley says, use the tick formatter to put the labels on the x axis that you want.
See this as an example.

Related

How to plot only within a range defined by x number of bars?

I understand that I can contingently plot on the chart using range of date and time values.
However, I would like to be able to plot using a specific number of candlesticks.
For example, I would like to be able to say something like
// Within the most recent 10 bars
// If close[0] > close[1]
// plotshape()
I have tried implementing numerous variations using barstate.isrealtime or barstate.islast but I keep running into limitations.
One major problem is that, although bar_index[#] works by indexing backwards from the most recent bar, the value of bar_index[10] is not 10 but some number in the thousands (depending on the timeframe of the chart — for me its Daily = 2,616 candles, 1hr = 6,217 candles, 15m = 5,222, etc.). In other words, it counts the number of bars from the oldest bar available.
Since referencing of the bars (starting from most recent) and the index values (starting from the oldest) are conflicting--due to counting from opposite ends--I am not sure how to specify: plotshape() for the most recent 10 bars.
I am also running into trouble due to the fact that bar_index[0] occurs every single iteration of the chart's timeframe--so I am getting caught in recursive calculations when trying to do bar_index[0]-bar_index[10].
It seems that what I need is something like bar_index.islast[10]
The reason that I would like to call a plotshape() based on the number of specified candles versus since x date/time (or within date range (x,y)), is because I want my indicator to function properly regardless of which timeframe my chart is displaying:
If I am showing a monthly chart, I want to plot across the last 10 monthly bars; If I am showing a daily chart, I want to plot across the last 10 daily bars; etc.
If I am forced to use a date range, then this functionality breaks down, since I will be shown increasingly more bars for smaller timeframes.
Caveat**
I am able to kinda make this work by specifying the number of bars from the oldest candlestick by stating something like:
bar_index > 2600 ? color=color.black : na
However, given the fact that every single time frame displays a different number of bars, this is not a workable solution for me.
Thanks for any advice.
UPDATE
I have been hunting around and and found that the functionality I desire is already built into the show_last argument of the various plot()functoins.
Ill leave my question posted, in case it helps someone else.
UPDATE I have been hunting around and and found that the functionality I desire is already built into the show_last = int argument of the various plot() functions.
I'll leave my question posted, in case it helps someone else.

Date-time axis working as string, not as proper continuous date/time axis in Zing Chart

I am plotting date-time vs integer in ZingChart. Even if there is difference of one second or the difference of 1 hour, the width is same between the two points. If the starting time is same as the previous one, like in my attached image at 23:24:40, there should not a white gap in between if it is proper date and time axis. Is there any solution to this problem? You can also view it on alnnovative.com/zing6.php
ZingChart will automatically place values at each index, unless you use key, value pairs as your data points. To do this, set your series object values like so:
"values":[
[1420070400000,50],
[1420071000000,50],
[1420070520000,50],
[1420070640000,50],
[1420070700000,50],
[1420070760000,50],
[1420070820000,50],
[1420070940000,50],
[1420071060000,50]
]
Take a look at this demo. I'm a member of the ZingChart team, let me know if you need more help.

Plot actual value on y axis in kibana 4

I want to plot time on x axis and a numeric field 'f' occurring at that time on y axis in kibana 4.
I have changed the data type of 'f' to integer and I can confirm that it has changed from kibana index settings.
However, the only aggregation options available for Y axis are count/min/max/sum etc. This post has an answer for plotting sum but I'm interested in plotting actual values.
Is there a way to do this?
You probably want to check this.
tl;dr
The data you want to plot, are not numbers.
Update your grok filter to something like this %{NUMBER:time:float} instead of whatever you have.
Re-index/re-hash your elasticsearch (i just deleted my data and restarted the whole thing)
Goto Kibana4 -> Visualize -> New line graph
In Y axis select max and in the field, select your number field.
Kibana is plotting a bucket, e.g. every minute.
As such, aggregations are in order. I frequently plot average and max on the same chart to give me a good overview.
If you reduce the time period, the buckets get smaller, but I don't think you can ever make them "just 1 document".

ASP.net chart control - XValueMembers Count

This is the first time I use chart control in ASP.net
I did the binding between the chart and a datatable to show the stats of revenue per date
Although,
When the selected dates are more than 9, the chart stops displaying them all on the X axis
It displays only 5
What is the reason?
Any workaround?
Any help would be appreciated
Similar problem was found here, and people there recommends to set up some properties, like this:
Try setting the AxisX Interval property to 1
Chart1.ChartAreas[0].AxisX.Interval = 1
note that you may then also want to change the angle of the labels
And after that, as you'll get a lot of values at axis X, you should change the angle for them. like this:
Chart1.ChartAreas[0].AxisX.LabelStyle.Angle = 45
Note that Chart1 is a Id of your chart, and can be different.

Broken axis in Google charts

Is there any way to create a break in my vertical scale on the Google charts api?
I have a couple of dozen data points all about 600-2000 on the y-axis except for one value which is almost 300,000; this makes all the smaller data points nearly unreadable. I need to represent all this data and a logarithmic scale is not an option.
Simple answer: no, it is not possible.
Breaking axes is (generally) frowned upon in the visualization community and therefore isn't supported most of the time in various software.
If you want to be tricky, you can create a function to find outliers, and then move them to a second series in your data. Plot that series on the second axis, and have it with a different color. This says, "This figure is different and does not fit" which brings added attention to it, while still allowing the rest of the data to be seen in the same scale.
Personally I would just cut off the graph at an arbitrary value, set the value of that point to the maximum value, and add a tooltip saying, "Outlier: 300,000" or whatever it is. This will allow people to see the other numbers, but show that this number itself is an outlier without coloring it differently or removing it from the single series.
Either way is doable.
You need use a log scale. It's a vAxis and hAxis attribute. The supported values are:
log: Conventional logarithm scale
mirrorLog: Logarithm scale that allows 0 values
var options = {
vAxis: {
scaleType: 'mirrorLog',
}
};
var data = {};//your data
chart.draw(data, options);

Resources