1

因此,我根据我通过 CodeSharp AOP 库收集的使用数据整理了一份代码指标报告。

饼图数据如下所示: 替代文字

但是,这是我得到的散点图: 替代文字

这是代码,经过修改以将数据集更改为文字数组并减去标签:

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Collections.Generic;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using GoogleChartSharp;
    
int[] totalCalls={161,35,15,100,94,87,84,84,76,76,76,74,74,71,71,69,69,23,66,61};        
int[] totalCPU ={ 180, 100, 94, 55, 52, 48, 47, 47, 42, 42, 42, 41, 41, 39, 39, 38, 38, 38, 37, 34 };

        int[] averageRunningTime={18,45,100,9,9,9,9,9,9,9,9,9,9,9,9,9,9,27,9,9};

        List<int[]> dataList = new List<int[]>();
        dataList.Add(totalCalls);
        dataList.Add(averageRunningTime);
        dataList.Add(totalCPU);
        

        ScatterPlot sp = new ScatterPlot(600, 300);

        ChartAxis totalCallsAxis = new ChartAxis(ChartAxisType.Left);
        totalCallsAxis.SetRange(15, 161);

        ChartAxis averageRunningTimeAxis = new ChartAxis(ChartAxisType.Bottom);
        totalCallsAxis.SetRange(9, 100);

        sp.SetData(dataList);



        Image1.ImageUrl = sp.GetUrl();

可能是什么问题呢?

万一有人一直在关注这个问题,这里是最新版本的散点图: 替代文字

4

2 回答 2

0

两种可能的解决方案:

  1. 您从未将 ChartAxis 类型显式添加到 ScatterPlot。查看Scatter Plots 示例,了解我从何处获取此信息。
  2. 此页面上的一个海报说他的散点图不起作用,因为他试图添加大于 100 的浮点值。我注意到你(可能,不确定,因为我以前没有使用过这个 API)正在做同样的事情。

希望这可以帮助!

于 2009-06-11T20:42:59.663 回答
0

基本上,CodeSharp 库对 Google Charts 坚持的数字编码做了一些诡计,这导致了这些奇怪的显示问题。我稍微修改了数据规范化程序并达到了我想要的结果。

于 2009-06-11T22:14:26.823 回答