【问题标题】:Best way to automatically generate highcharts image自动生成highcharts图像的最佳方法
【发布时间】:2015-10-05 13:59:15
【问题描述】:

我的应用上有一些图表,我需要自动生成图像(例如:按天)以通过电子邮件发送。

环境

  • 用于网站的 ASP.NET MVC
  • Highcharts
  • 托管在 azure 网站上

我正在使用 highcharts,首选是服务器导出模块,但是使用 azure 网站我无法在服务器上设置 phantomjs。

我还研究了“谷歌图表图像”,但它已被弃用。

我正在考虑使用 Chart (System.Web.Helpers):

例如:

public ActionResult GetChartImage()
{
    var key = new Chart(width: 300, height: 300)
        .AddTitle("Employee Chart")
        .AddSeries(
            chartType: "Bubble",
            name: "Employee",
            xValue: new[] { "Peter", "Andrew", "Julie", "Dave" },
            yValues: new[] { "2", "7", "5", "3" });

    return File(key.ToWebImage().GetBytes(), "image/jpeg");
}

但想知道是否还有其他选项可以继续使用 Highcharts。

【问题讨论】:

  • 嗨,这正是我需要做的(除了 Azure)。你有没有使用 highcharts 找到解决方案?
  • @dreza 很遗憾没有,目前此要求不再需要。如果您需要使用 highcharts,您将需要一个 VM。

标签: asp.net asp.net-mvc azure highcharts


【解决方案1】:

在服务器上为 Azure Web App 生成图表的唯一方法 -> 使用 ms-chart。 您只能使用 Azure VM 在服务器上生成 highcharts。

【讨论】:

  • 你说得对,至少现在只能在 Azure VM 上使用 highcharts 导出。幸运的是,我不再需要这样做了。谢谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-03-16
  • 2020-07-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多