New asp.net charting controls – will they work with MVC (eventually)?

You can use the chart controls in two ways: Generating the Image from a Controller By generating the chart and returning it as an image from an action (as Chatuman is referring to I think): Chart chart = new Chart(); chart.BackColor = Color.Transparent; chart.Width = Unit.Pixel(250); chart.Height = Unit.Pixel(100); Series series1 = new Series(“Series1”); series1.ChartArea … Read more

Charts.js graph not scaling to canvas size

The width and height property that you set for the canvas only work if the Chartjs’ responsive mode is false (which is true by default). Change your stats_tab.js to this and it will work. window.onload=function(){ var ctx = document.getElementById(“myChart”).getContext(“2d”); var myChart = new Chart(ctx, { type: ‘line’, data: { labels: [1,2,3,4,5,6,7,8,9,10], datasets: [ { label: … Read more

What is your preferred way to produce charts in a Ruby on Rails web application?

Google Charts is an excellent choice if you don’t want to use Flash. It’s pretty easy to use on its own, but for Rails, it’s even easier with the gchartrb gem. An example: GoogleChart::PieChart.new(‘320×200’, “Things I Like To Eat”, false) do |pc| pc.data “Broccoli”, 30 pc.data “Pizza”, 20 pc.data “PB&J”, 40 pc.data “Turnips”, 10 puts … Read more

Click events on Pie Charts in Chart.js

Update: As @Soham Shetty comments, getSegmentsAtEvent(event) only works for 1.x and for 2.x getElementsAtEvent should be used. .getElementsAtEvent(e) Looks for the element under the event point, then returns all elements at the same data index. This is used internally for ‘label’ mode highlighting. Calling getElementsAtEvent(event) on your Chart instance passing an argument of an event, … Read more

Hide axis and gridlines Highcharts

Just add xAxis: { … lineWidth: 0, minorGridLineWidth: 0, lineColor: ‘transparent’, … labels: { enabled: false }, minorTickLength: 0, tickLength: 0 } to the xAxis definition. Since Version 4.1.9 you can simply use the axis attribute visible: xAxis: { visible: false, }

Barchart with vertical labels in python/matplotlib

Do you mean something like this: >>> from matplotlib import * >>> plot(xrange(10)) >>> yticks(xrange(10), rotation=’vertical’) ? In general, to show any text in matplotlib with a vertical orientation, you can add the keyword rotation=’vertical’. For further options, you can look at help(matplotlib.pyplot.text) The yticks function plots the ticks on the y axis; I am … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)