Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var data = [6];
- data.push([10, Math.round(Math.random() * 100)]);
- $('#jqChart').jqChart({
- title: { text: 'Change Series' },
- border: { strokeStyle: '#6ba851' },
- background: background,
- legend: { visible: false },
- axes: [
- {
- type: 'none',
- location: 'bottom',
- minimum: 0,
- maximum: 6
- },
- {
- type: 'linear',
- location: 'left',
- minimum: 0,
- maximum: 100
- }
- ],
- series: [
- {
- type: 'line',
- data: CallWebMethod() //REPLACING THIS WITH "data" WORKS
- }
- ]
- });
- }
- function CallWebMethod() {
- $.ajax({
- type: "POST",
- url: "Default4.aspx/CallWebMethod",
- data: '{name: "" }',
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- async: true,
- success: OnSuccess,
- failure: function (response) {
- alert(response.d);
- }
- });
- }
- function OnSuccess(response) {
- return response.d;
- }
- **[System.Web.Services.WebMethod]
- public static List<MyGenericType<dynamic>> CallWebMethod(string name)
- {
- List<MyGenericType<dynamic>> myList = new List<MyGenericType<dynamic>>();
- myList.Add(new MyGenericType<dynamic>() { x = 10, y = 20 });
- myList.Add(new MyGenericType<dynamic>() { x = 10, y = 20 });
- myList.Add(new MyGenericType<dynamic>() { x = 10, y = 20 });
- return myList;
- }**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement