Home forums Using CanvasJS Use custom title for data

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #29507

    Hi, I am attempting to use a custom title for each data set in my graph.

    I have tried this:

    data: [{
    type: “line”,
    name: @Html.Raw(ViewBag.DataPoints1Title),
    showInLegend: true,
    dataPoints: @Html.Raw(ViewBag.DataPoints1)
    },

    Setting the ‘name’ field to the ViewBag. It does not work. How can I use the ViewBag in order to set a title?

    #29519

    @eli-hellmer,

    Can you kindly create a sample project reproducing the issue you are facing and share it with us over Google-Drive or Onedrive along with the sample data along with a brief description of your exact requirement so that we can look into the code, run it locally to understand the scenario better and help you resolve?

    From what we have observed, sometimes things get delayed mostly when we are not able to reproduce the issue or not able to understand the exact requirements or the solution that we provide may not work properly due to the variation in chart-options being used by you and us.

    Having a sample project helps us in figuring out the issue and suggesting an appropriate solution accordingly.


    Shashi Ranjan
    Team CanvasJS

    #29521

    I don’t think a sample project is necessary. All I am asking is how can I make a custom name for my chart elements?

    In the example above I attempted to use the Viewbag and it did not work.

    #29558

    @eli-hellmer,

    It seems to be working fine at our end.

    Can you kindly create a sample project reproducing the issue you are facing and share it with us over Google-Drive or Onedrive along with the sample data along so that we run the code locally to understand the scenario better and help you out?


    Shashi Ranjan
    Team CanvasJS

    #29560

    I fixed it. The issue was I didn’t have quotes (“) around the @Html.Raw. It seems like a simple fix and I’m confused as to why this was not mentioned to me earlier.

    #29575

    @eli-hellmer,

    Glad you fixed it :)

    From what we have observed, sometimes things get delayed mostly when we are not able to reproduce the issue at our end or not able to understand the exact requirements or due to the variation in chart-options being used by you and us. Because of these reasons we expect you so share sample project along with sample data(dummy data) which helps us run it locally at our end to understand the use case and help you resolve the issue you are facing.

    You can also refer to this article for passing data from controller to view in ASP.Net MVC.


    Shashi Ranjan
    Team CanvasJS

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.