Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- public chart ChartUser(string UserId)
- {
- chart c = new chart();
- SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=emp;Integrated Security=True");
- // SqlDataAdapter da = new SqlDataAdapter("select * from ChartPie where id= UserId + "'", con);
- con.Open();
- SqlCommand cmd = new SqlCommand("select * from ChartPie where id='" + UserId + "'", con);
- SqlDataReader dr = cmd.ExecuteReader();
- while (dr.Read())
- {
- c.UserId = dr["UserId"].ToString();
- c.Language = dr["Language"].ToString();
- c.percentage = dr["percentage"].ToString();
- }
- return c;
- }
- public class chart
- {
- public string UserId { get; set; }
- public string Language { get; set; }
- public string percentage { get; set; }
- }
- }
- var chart = AmCharts.makeChart("chartdiv", {
- "type": "pie",
- "theme": "none",
- "legend": {
- "markerType": "circle",
- "position": "right",
- "marginRight": 80,
- "autoMargins": false
- },
- "dataProvider": [{
- "Language": "Tamil",
- "percentage": 50
- }, {
- "Language": "English",
- "percentage": 40
- }, {
- "Language": "Hindi",
- "percentage": 30
- }],
- "valueField": "percentage",
- "titleField": "Language",
- colorField: "color",
- "balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
- "exportConfig": {
- "menuTop": "0px",
- "menuItems": [{
- "icon": '/lib/3/images/export.png',
- "format": 'png'
- }]
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement