Click here to Skip to main content
15,908,175 members

Comments by ChessGirl (Top 1 by date)

ChessGirl 10-Jul-15 5:30am View    
This worked for me! As a newbie, I had to figure out that it went between script tags and I could use it to pick up an array that I'd passed through the ViewBag:

@{int[] graphNumbers = ViewBag.GraphNumbers;}
<script type="text/javascript">
var graphNumbers = [@Html.Raw(String.Join(",", graphNumbers.Select(i => "'" + i + "'")))];
</script>
This passed the array through perfectly, and my Chart.js graph now works!

Thanks very much!