How to bind bar chart(columns) to array list object in c# win form
how to bind bar chart(columns) to array list object in c#win form
Hi Ramesh,
Did you want to bind list object to bar chart? I made a simple code to achieve binding list to bar chart.
public partial class Form0210 : Form
public Form0210()
InitializeComponent();
private void Form0210_Load(object sender, EventArgs e)
BindData();
public void BindData()
List<int> yValues = new List<int>(new int[] { 20, 30, 10, 90, 50 });
List<string> xValues = new List<string>(new string[] { "1:00", "2:00", "3:00", "4:00", "5:00" });
chart1.Series[0].Points.DataBindXY(xValues, yValues);
The links below might be useful to you:
# Data Binding Microsoft Chart Control
http://blogs.msdn.com/b/alexgor/archive/2009/02/21/data-binding-ms-chart-control.aspx
# Series and Data Points (Chart Controls)
https://msdn.microsoft.com/en-us/library/vstudio/dd456769(v=vs.100).aspx
In addition, if I misunderstood you, please share us more information about your issue.
Best Regards,
Edward
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.
Similar Messages
-
How to bind each DataGrid column separately?
Good day fellow Flex developers!
Could you please help me out. I am trying to figure out how to bind each DataGrid column separately. I need to bind each column to a separate bindable array variable. Is there a dataProvider property for each DataGridColumn???
Thanks in advance,
Eugenehopefully nope
just imagine code complexity for that feature?
how would you think should behave DataGrid when you'll populate your separate arrays with variable items number each?
all you are able and should do is to build composite dataProvider source, join all your separate arrays into it, this is your responsibility.
If you feel this message answers your question or helps, please mark it respectively -
How to update a chart when the array is updated
Hi I am using an array to populate a chart in FB3 and having trouble updating the chart when the array is updated.
Chart
<mx:Label id="archiveTitle" x="10" y="10" text="Current Archive " fontSize="14" fontWeight="bold"/>
<mx:PieChart id="chart" height="130" width="300" color="0x323232"
showDataTips="false" dataProvider="{ratingAC}" y="22">
<mx:series>
<mx:PieSeries field="Rating"/>
</mx:series>
</mx:PieChart>
Array + Vars
[Bindable]
public var newsDB:ArrayCollection = mx.core.Application.application.newsDB as ArrayCollection;
[Bindable]
private var positive:int = 1;
[Bindable]
private var neutral:int = 0;
[Bindable]
private var negative:int = 0;
[Bindable]
private var ratingAC:ArrayCollection = new ArrayCollection([
{ Rating: 1 }, // no data
{ Rating: positive }, // [0] positive
{ Rating: neutral }, // [1] neutral
{ Rating: negative } // [2] negative
private function init():void{
buildChart();
newsDB.addEventListener(CollectionEvent.COLLECTION_CHANGE, test);
newsDB.addEventListener(CollectionEvent.COLLECTION_CHANGE, buildChart);
private function test(e:CollectionEvent):void{
trace("array changed");
positive = 20
private function buildChart(e:CollectionEvent=null):void{
for(var i:int; i<newsDB.length; i++){
if(newsDB[i].rateItem == 0){
trace(positive);
positive += 1;
//ratingAC.setItemAt(positive,0);
trace(positive);
if(newsDB[i].rateItem == 1){
neutral += 1;
if(newsDB[i].rateItem == 2){
negative += 1;Sorry, in my app I have an ArrayCollection of items from a news feed that the user has deemed important, and given each item a rating. The For loop will loop through the "newsDB" array and set the var accordingly (positive, negative, neutral). The variables are what is populating the arrayCollection (ratingAC). How would I either a) bind the variables to the ArrayCollection so that it updates when one has changed, or b) update the specific index in the array collection. When debugging, i notice that the variables are updating, but the arrayCollection is not.
Thanks in advance! -
How to display bar charts in jsp
I need bar charts for web application.
I search alot but I didn't find any solution.
From where I can find the content for same?You're right I did read about Cewolf. Here's how
You can simply define a chart by including a chart tag into your JSP like this:
<cewolf:chart
id="XYChart"
type="xy"
title="XYChart"
<cewolf:gradient>
<cewolf:point x="0" y="0" color="#FFFFFF"/>
<cewolf:point x="0" y="300" color="#C8C8C8"/>
</cewolf:gradient>
<cewolf:data>
<cewolf:producer id="xyData"/>
</cewolf:data>
</cewolf:chart>
<cewolf:img chartid="XYChart" renderer="cewolf" width="400" height="300"/>
keep coding..
Ciao.
Div -
HOW TO creat BAR CHART using ABAP Programming
DEAR ALL,
I want some help as to how to creat GRAPHICAL display using ABAP programing (BAR CHART) any sample codes Example will be very helpful.
Regards,
VJOn earlier versions, you can do something like this.
[code]
REPORT ZRICH_0005 .
DATA: BEGIN OF ITAB_DATA OCCURS 0,
DATANAME(15),
QUANTITY1 TYPE I,
QUANTITY2 TYPE I,
QUANTITY3 TYPE I,
END OF ITAB_DATA.
Data: BEGIN OF ITAB_OPTIONS OCCURS 0,
OPTION(20),
END OF ITAB_OPTIONS.
ITAB_DATA-DATANAME = 'Maple'.
ITAB_DATA-QUANTITY1 = 5500.
ITAB_DATA-QUANTITY2 = 6200.
ITAB_DATA-QUANTITY3 = 5900.
APPEND ITAB_DATA.
ITAB_DATA-DATANAME = 'Oak'.
ITAB_DATA-QUANTITY1 = 3500.
ITAB_DATA-QUANTITY2 = 5200.
ITAB_DATA-QUANTITY3 = 4400.
APPEND ITAB_DATA.
ITAB_DATA-DATANAME = 'Cherry'.
ITAB_DATA-QUANTITY1 = 1800.
ITAB_DATA-QUANTITY2 = 2200.
ITAB_DATA-QUANTITY3 = 1900.
APPEND ITAB_DATA.
CALL FUNCTION 'GRAPH_MATRIX_3D'
EXPORTING
COL1 = 'Jan'
COL2 = 'Feb'
COL3 = 'Mar'
TITL = 'Lumber Usage in $'
TABLES
DATA = ITAB_DATA
OPTS = ITAB_OPTIONS
EXCEPTIONS
OTHERS = 1.
[/code]
Regards,
Rich Heilman -
How to plot bar chart using iReport with Struts 2
Hi All
Im working on iReport 3.5.1 to generate jasper report for our java enterprise application. Here, I have no problem, when im generating simple report[without any chart]. When i try to add a bar chart to jasper report, i coudnt get the exact chart what i wanted, im just getting some ridiculous chart which is exactly wrong, i guess the problem is with the data given to plot the chart. Do, anybody know how to transport data to plot the bar chart in iReport. For Simple chart im using javabeans to generate report, but for chart, how it should be?
Thanks in advance
Thanks and Regards
Baskaran
Edited by: Baskaran on May 22, 2009 12:36 PMjxl does not support create chart from scratch.
Maybe you can do it by using excel template:
define a chart in the sheet,using definedName or fixed range as chart data source. -
Hi All,
I need to create Spidar (Radar) chart in my application with the help of an array collection object........can any one help me ?? do i need to import any external library ???
Please provide the required code for it .........
Thanks in advance....You'll need to set the "series" property of the chart. This will be an array of BarSeries objects.
You may also need to set the horizontalAxis and verticalAxis properties for the chart. (I forget if there are defaults for these.) -
How do you print items from an array list that fit a certain condition?
I have an array list full of people. People can be set to single or married, is there anyway I can just display the people from the arraylist that are married? I've been reading through alot of stuff about arraylists and there doesnt seem to be anything on printing things depending on context.
thebigfish wrote:
I have an array list full of people. People can be set to single or married, is there anyway I can just display the people from the arraylist that are married? I've been reading through alot of stuff about arraylists and there doesnt seem to be anything on printing things depending on context.Have you tried simply iterating over the list, checking for your condition, and printing out the person's details?
for ( Person p : yourListOfPeople ) {
if ( p.isMarried() ) { // Assuming isMarried returns a boolean value determining if the person is married
System.out.println( p ); // Assuming you've overriden toString
} -
How to create Bar chart from existing XML file
Hi all,
i'm new to flex, i need your help to develop a flex for
dashboard app. we have sample.xml file. by using this i need to
create a bar diagram or piechart.
Please help me out
The XMl looks like this.....
<?xml version="1.0" encoding="utf-8"?>
<user id="123412343">
<fullName>
<lastName>Telles</lastName>
<firstName>vijay</firstName>
</fullName>
<preferences>
<modWidth>235</modWidth>
<modHeight>250</modHeight>
<totalWidth>1650</totalWidth>
<totalHeight>1650</totalHeight>
<modsX>4</modsX>
<modsY>2</modsY>
</preferences>
<module id="Status2">
<windowOpen>true</windowOpen>
<pointsToShow>
<p label="Proposed"/>
<p label="Draft"/>
<p label="DEP Adpt"/>
<p label="EPA Adpt"/>
</pointsToShow>
<dataSetsToShow>
<label>2006</label>
<label>2007</label>
</dataSetsToShow>
</module>
</user>convert this xml to ArrayCollection called chartData
var charOption:String = "totalHeight"; /Use this to set the
yField property...
<mx:ColumnChart showDataTips="true" id="barChart"
width="100%" height="100%" dataProvider="{chartData}"
color="0xffffff">
<mx:horizontalAxis>
<mx:CategoryAxis
dataProvider="{chartData}"
categoryField="hour" />
</mx:horizontalAxis>
<mx:verticalAxis>
<mx:LinearAxis labelFunction="addDollarSign"/>
</mx:verticalAxis>
<mx:series>
<mx:ColumnSeries yField="{chartOption}"
showDataEffect="interpolate"
creationCompleteEffect="interpolate"/>
</mx:series>
</mx:ColumnChart> -
How to display the contents of an array list to a listview?
Hi. How do I display the contents of an arraylist to a listview?
Here is my current code:
var c: Control= new Control();
var simpleList: ArrayList = c.ListResult; //ListResult is an ArrayList containing strings
var simpleListView : ListView = ListView {
translateX: 0
translateY: 0
layoutX: 20
layoutY: 80
height: 130
width: 200
items: bind simpleList;
Stage {
title: "Trial app"
width: 240
height: 320
style: StageStyle.TRANSPARENT
scene: Scene {
content: [ simpleListView
} [http://img341.imageshack.us/img341/133/listview.jpg]
My code generates the result in this screenshot above. It shows that all the contents on the arraylist is displayed in one row/item.
It should be displayed as (see bottom image) ...
[http://img707.imageshack.us/img707/3745/listview1.jpg]
Do you guys have any idea on this? Thank you very much for your repliesFor your listbox data to bind the listbox requires a Sequence. This is something that you can sort out at the entrypoint of your code.
In the example below I have used an ArrayList to simmulate the data you have entering your FX code, but then I put that list into a Sequence, in your case instead of having an ArrayList in your FX code, you simple supply the list on entry, as I have marked in the following code.
* Main.fx
* Created on 12-Feb-2010, 10:24:46
package uselists;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
import java.util.ArrayList;
import javafx.scene.control.ListView;
import javafx.animation.Timeline;
import javafx.animation.KeyFrame;
* @author robert
//Simmulate your data with an ArrayList
var simpleList: ArrayList = new ArrayList;
simpleList.add("Hello");
simpleList.add("World");
// *** This is what your entry point would become, just load the simpleList.toArray() into your sequence ***
var simpleSequence = [];
simpleSequence = simpleList.toArray();
//after some time add some items, to show that our binding is working
Timeline {
repeatCount: 1
keyFrames: [
KeyFrame {
time: 5s
canSkip: true
action: function () {
//you can work on the Sequence to add or remove
insert "Another item" into simpleSequence;
//if you at some point want to have your array reflect the changes
//then perform your changes on that too
simpleList.add("Another item");
//remember depending on your app
//you may keep the update of simpleList
//until you are finished with this view and do it in a single update
KeyFrame {
time: 10s
action: function () {
//Alternatly, to keep your ArrayList correct at all times
//add items to it and then update your Sequence
simpleList.add("Added to array");
simpleSequence = simpleList.toArray();
}.play();
Stage {
title: "Application title"
scene: Scene {
width: 250
height: 80
content: [
ListView {
items: bind simpleSequence
}You can bind to a function rather than the data, which I am sure would be needed some cases, for example if the listBox data was a named part of a hash value for example, all that is required is that your function returns a sequence. -
How to fill the first column '#' of matrix with row id in user form?
Hi All,
I am having a user defined form in which, I m having a matrix and m populating the matrix with the output of an sql query.
something like this:
SQL_Str= "select col1,col2,......from.... "
OPopDBTable.ExecuteQuery(SQL_Str)
oMatrix.AddRow()
oMatrix.Columns.Item("Col3").DataBind.Bind("PopTable", "col1")
oMatrix.Columns.Item("Col2").DataBind.Bind("PopTable", "col2")
oMatrix.LoadFromDataSource()
Now, in this, how can I assign row number to first column ('#' column ) ??
regards,
BinitaAh...the ROW_NUMBER() was posted by Petr - also thank you (again)
With my example-query from the other thread:
SELECT
CAST(
ROW_NUMBER() OVER (ORDER BY T1.U_LogNo ASC) AS INT
) AS RowCnt,
T1.Code,
T1.U_ParcelNo,
T1.U_LogNo
FROM
[@XXX_EXAMPLE] T1
WHERE
T1.U_ParcelNo='132006'
ORDER BY
T1.U_LogNo ASC
...this works for me (it's quickly copied from several subs/func. - I hope it's not too much disordered):
DtLogs.ExecuteQuery(query)
oMtxLogs.Columns.Item("0").DataBind.Bind("DT_LOGS", "RowCnt")
oMtxLogs.Columns.Item("1")........
oMtxLogs.LoadFromDataSource() -
How to create a hyperlink column in External List (BCS) ?
We have an external list set up that gets data from an external content type through a web service (done through BCS). Everything works fine except the fact that one of the fields is supposed to show up as a hyperlink but it shows up as text. Any idea how
to modify this?
Example: The webservice object has 2 properties like this:
Public Class MyObject
Public string MyTitle{ get; set;}
Public string MyLink{ get; set;}
MyLink = "http://www.somewebsite.com"
The external list shows up with 2 coulmns MyTitle, MyLink. But MyLink is not clickable as a hyperlink. If you look at the list settings, the MyLink column is a text field.
Some of the answers I got suggested that system.uri is not supported in external list. What I ended up doing for now was to create a regular list (which supports hyperlinks) and dump data to it directly from the webservice ditching BCS. But we
will be using BCS quite a bit and if some can give me a definitive answer on hyperlink support in external list, I would appreciate it. Is that a bug?Hi,
I think you have to look into http://msdn.microsoft.com/en-us/library/ff407509.aspx and SPCustomFieldType. You might do this:
<TypeDescriptor Name="MyLink" TypeName="System.String">
<Properties>
<Property Name="SPCustomFieldType" Type="System.String">Url</Property>
</Properties>
</TypeDescriptor>
But I haven't been able to test it out. -
How to add new elements in an array of Objects of Type Figure??
I have a Figure class which has many attributes(variables). Then I create an array of Figures for example
Figs[] figures = new Figure[18];
Later I need to add new Figures to this array at different positions. In my case I have to use the same array.
Is there any way so I can add new Figure elements to this array??
If u have an answer to this question, please share with me.
Thanks
AmitThere are many ways to solve this problem, including creating new arrays as needed, and using System.arraycopy() to move things around. However, the best way is to use ArrayList, as discussed above.
What you cannot do is use toArray() and cast back to String[]. Object[] is not a subclass of String[], even if all of the objects in the Object[] are Strings!
There are two ways to get around this. Create a String[] and copy the Object[] into it with System.arraycopy, or the easy way, which is to use the toArray(Object[]) method. It allows you to specify by example the array class you wish returned. If the array is large enough, it will populate the array directly, otherwise it will create a new one of the same base class. That means any of the following approaches will work, the final decision is mostly a matter of style:
// create a zero length array to pass as an exemplar
public final static String STRING_ARRAY_TYPE[] new String[0];
String s[] = (String[]) a.toArray(STRING_ARRAY_TYPE);Or:
String t[] = new String[a.size()];
a.toArray(t);Or:
String t[] = a.toArray(new String[a.size()]);;I prefer the first approach generally, and it avoids any race conditions between the evaluation of the ArrayList size and the toArray; however, since ArrayList methods are not synchronized, you probably should do some synchronizing of your own.
Hope this helps. -
How to bind the value of textbox with View object's bind variable?
Hi all,
In my use case I need to pass the value of textbox in the jsf page to the View Object's bind variable.
I should not hard code this in my backing bean. I need to configure in the Jdeveloper itself.
I am using Jdeveloper 11.1.1.4.0 version. Kindly come up with your help.
Thanks,
Phani.Hi,
You have to use Named Bind Variables(ExecuteWithParams)
http://download.oracle.com/docs/cd/B31017_01/web.1013/b25947/web_search_bc004.htm
http://www.cloudsolid.com/2008/10/using-named-bind-variables.html -
How to bind UI control after having created view object
Hi,
I'm creating view object from an sql query
vo = panelBinding.getApplication().getApplicationModule().createViewObjectFromQueryStmt("ViewObj", strSQL);
and I want set model to a table
table1.setModel((TableModel)panelBinding.bindUIControl("ViewObj", table1));
but it doesn't work and shows null pointer exceptionTake a look at the static createAttributeListBinding() methods in JUTableBinding.
Sascha
Maybe you are looking for
-
Oracle Application Server 10g Cloning
Hi All, Could anyone please advice on How we can create a cloned copy of 10g AS(including infra DB) for DR purpose.Any document or guideline will be highly appreciated. Regards,
-
Problem with non-supported paper sizes
Hi, I would like to know what happens when paper size suzh as A3 is given to printer for printing, if that A3 paper size is not supported by printer. How it is handled. Will it print in A4 paper with A3 scaling. Please help, Thanks in advance.
-
Export and Import in Data warehouse
Hi, I have built a data warehouse project with few dimensions and a cube on a server machine, say server1. Now i have another server machine on which i want to develop this project for bulk production. I want to import all the developments from serve
-
HP Photosmart 3210XI photo's smear
I have an HP Photosmart 3210Xi that has worked well for years. All of a sudden any photo's I print come out smeared,blurry and very wet. I have tried the printer on two different machines under two different operating systems. I get the same results
-
Global Cache and Information Broadcasting
I've been reading about the Reporting Agent which was in previous versions of BW, and how when you ran scheduled a query from this it would store the result in the global cache. This meant that subsequent runs of the report would be a lot quicker. It