I have 2 Y-axis on the chart and I am trying to use annotationElement's localToData to get the data points associated with a Point on the chart.
The annotation Element is able to return a set of values for the point ( 1 Y - data, 1 -x data), But it is returning the values against one axis and not the other.
Is there a way to associate the annotation element with a specific axis ?
Sorry, this is more of a Flex issue which I did not fully understand at the time of posting.
At that time, My plot series was associated with right axis and hence I felt there was coding error on my end when i called localToData.
Anyway, there is a bug in Flex PlotSeries localToData method that shows up only if you have flex debugger installed.
The bug is a Null Pointer exception on Plot Series code while trying to get filtered data.
Related
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.
When a graph is very wide I want to show the y-axis values also on the right side of the graph so it becomes easier to read the corresponding values of the lines.
I know how to duplicate the left axis to the right. And when the graph is created I use ActYscl to set the range of scale nr 0 (left) to scale nr 1 (right). This works when the graph is created and also the zoom and pan function work on both y-scales. However, when I use the Autoscale function of the Graph Pallet, only the initial axis is scaled (probably because the graph data are only linked to the original axis).
Is there a way to make the autoscale function work for both y-axis at the same time?
Charts and graphs have an Autoscale Range Change event. Use an event structure to catch this event and update the range of the duplicate scale to match the first one:
I've used a chart for this example as it's simpler, but it should work the same for a graph. Of course you need a way of telling the event loop when to exit; I've used the Value Changed event of the stop button. If your application uses an event-driven structure anyway, you should just be able to add the autoscale event to your existing event loop.
I want to plot stacked column graph through Shinobi.
Please referer attached screen shot for desired graph.
Can anyone please suggest how to pass data point for the same.
Disclaimer: I am a developer at Shinobi Controls.
To get columns to stack you need to create a series for each column you wish to stack.
To get the series to stack, you must set each series' "stackIndex" property to the same value.
For example, in your image you will need 5 SChartColumnSeries with their "stackIndex" value set to the same value, lets say 1.
Now you can add one datapoint for each series with the same X value but with different Y values.
I have a real-time line chart. For that I use TimeSeries. Now I get new values every second. But I don’t want to get a x-axis line every second. I like to get one every ten seconds.
So maybe, first it would be important to know where the x-axis lines were painted. Is it xymultipleseriesdataset.addSereies(timeSeries)? So maybe I can create a loop that add every 10 second a new title for the x-Axis... or am I totally wrong?
If I am right, you are asking for a way to control which labels are shown on the x-axis.
To do that, you may use the XYMultipleSeriesRenderer.addXTextLabel(timeInMillis, "requiredlabel").
This will cause the automatic generation of labels to stop and you can then have complete control on which labels are shown and which are not.
Edit:
Seems like I was wrong about automatic generation of labels stopping.
Use the method XYMultipleSeriesRenderer.setXLabels(0) to stop the generation of labels. This method is used to set how many labels should be generated for the x axis. Passing 0 should stop automatic labels to stop altogether.
I am refering to the official asp.net tutorial http://msdn.microsoft.com/en-us/library/dd456655.aspx . What i did is,,, in an fresh asp.net website, i added a chart control from the toolbox and dragged a table it to from my database. The problem starts now when i added a button and put the forecasting code in the button click event. The code is:
Chart1.DataManipulator.FinancialFormula (FinancialFormula.Forecasting, "2,40,true,true", "Series1:Y", "Series2:Y,Series3:Y,Series3:Y2");
The error message i got is
Forecasting Error – There are too few data points for this regression
type. A minimum of 2 data points are required.
In the chart, i selected "date" as x-axis, and "some number" as Y-axis... And what is this minimum of 2 data points required...
Can anyone help me out with this error.......
This question is a bit old, but I ran across this same situation today and wanted to post my resolution.
This "Too Few Data Points" issue occurs when the the trend line is added before the chart is bound. Simply moving the Financial Formula code below where the data is bound will resolve the issue. (Of course, if you have less than 2 data points in your binding, this won't help you).
Basically, until the chart is bound, the "input series" doesn't actually have the data to be used by the Chart's DataManipulator.
For predicting the future values at least two past values are needed,so if the result contains only one value it will throw error,because it is not possible to compare the values.The series in the chart should have minimum 2 values