JFreeChart X 轴标签超出图表区域

2023-12-10

我有一个JFreeChart图表与DateAxis作为域。它看起来非常漂亮,但是最后一个轴标签有时会超出图表区域。这是要重现的示例代码:

public class LineChart_AWT extends ApplicationFrame {

    public LineChart_AWT( String applicationTitle , String chartTitle ) {
          super(applicationTitle);

          ValueAxis timeAxis = new DateAxis("");
          NumberAxis valueAxis = new NumberAxis("Number");
          ((DateAxis)timeAxis).setDateFormatOverride(new SimpleDateFormat("YYYY-MM-dd HH:mm"));
          XYPlot plot = new XYPlot(createDataset(), timeAxis, valueAxis, null);
          XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);

          plot.setRenderer(renderer);
          plot.getRangeAxis().setAutoRange(true);
          ((NumberAxis)plot.getRangeAxis()).setAutoRangeIncludesZero(false);
          JFreeChart lineChart = new JFreeChart(chartTitle, plot);
          plot.setBackgroundPaint(Color.lightGray);

          plot.setDomainGridlinesVisible(true);
          plot.setRangeGridlinesVisible(true);
          plot.setDomainGridlinePaint(Color.white);
          plot.setRangeGridlinePaint(Color.white);

          lineChart.setBackgroundPaint(Color.white);
          ChartPanel chartPanel = new ChartPanel( lineChart );
          chartPanel.setPreferredSize( new java.awt.Dimension( 560 , 367 ) );
          setContentPane( chartPanel );
       }

       private TimeSeriesCollection createDataset( ) {
           TimeSeries typeA = new TimeSeries("TypeA");
         TimeSeries typeB = new TimeSeries("TypeB");
         TimeSeriesCollection collection = new TimeSeriesCollection();

         collection.addSeries(typeA);
         collection.addSeries(typeB);
         typeA = collection.getSeries("TypeA");

         typeA.add(new Hour(8, new Day()), 1.0);
         typeA.add(new Hour(10, new Day()), 1.0);
         typeA.add(new Hour(11, new Day()), 1.0);
         typeA.add(new Hour(13, new Day()), 1.0);
         typeA.add(new Hour(16, new Day()), 2.0);
         typeA.add(new Hour(18, new Day()), 2.0);

         typeB.add(new Hour(8, new Day()), 1.0);
         typeB.add(new Hour(19, new Day()), 2.0);
         typeB.add(new Hour(20, new Day()), 5.0);


          return collection;
       }

       public static void main( String[ ] args ) {
          LineChart_AWT chart = new LineChart_AWT(
             "X-axis demo" ,
             "X-axis labels are truncated");

          chart.pack( );
          RefineryUtilities.centerFrameOnScreen( chart );
          chart.setVisible( true );
       }
    }

这是当前的屏幕截图;问题可以在最后一个标签上看到:

date labels clipped

是什么导致最后一个标签呈现在当前图表区域之外?另外,我该如何预防呢?

UPDATE

这是一个更全面的示例,包含屏幕截图和所有详细信息。

According to @trashgod's comments, I've updated to the latest JFreeChart Engine (jfreechart-1.0.19.jar and jcommon-1.0.23.jar) (jfreechart-1.6.0-snapshot.jar).

考虑这个例子(它深深依赖于@trashgod的建议 - 非常感谢):

import java.awt.Color;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.text.SimpleDateFormat;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
import org.jfree.chart.ui.ApplicationFrame;
import org.jfree.data.time.Minute;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;

/**
 * @see https://stackoverflow.com/a/57637615/230513
 * @see https://stackoverflow.com/a/57544811/230513
 */
public class TimeChart extends ApplicationFrame {

    private static boolean lot_of_values = false;

    public TimeChart(String applicationTitle, String chartTitle) {
        super(applicationTitle);

        DateAxis timeAxis = new DateAxis("Timestamp");
        timeAxis.setUpperMargin(DateAxis.DEFAULT_UPPER_MARGIN /* * 2*/); // UPDATED
        timeAxis.setLowerMargin(DateAxis.DEFAULT_LOWER_MARGIN /* * 2*/); // UPDATED
        timeAxis.setDateFormatOverride(new SimpleDateFormat("YYYY-MM-dd HH:mm"));
        NumberAxis numberAxis = new NumberAxis("Number");
        numberAxis.setAutoRangeIncludesZero(false);
        XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);
        XYPlot plot = new XYPlot(createDataset(), timeAxis, numberAxis, renderer);
        plot.setBackgroundPaint(Color.lightGray);
        plot.setDomainGridlinePaint(Color.white);
        plot.setRangeGridlinePaint(Color.white);
        JFreeChart lineChart = new JFreeChart(chartTitle, plot);
        lineChart.setBackgroundPaint(Color.white);
        ChartPanel chartPanel = new ChartPanel(lineChart) {
            @Override
            public Dimension getPreferredSize() {
                return new Dimension(1529 , 538);
            }
        };
        add(chartPanel);
    }

    private TimeSeriesCollection createDataset() {

        TimeSeries typeA = new TimeSeries("Temperatures");
        TimeSeriesCollection collection = new TimeSeriesCollection();

        collection.addSeries(typeA);

        if (lot_of_values) {
            typeA.add(Minute.parseMinute("2019-08-25 00:00"), 26.68);
            typeA.add(Minute.parseMinute("2019-08-25 01:00"), 26.75);
            typeA.add(Minute.parseMinute("2019-08-25 02:00"), 25.95);
            typeA.add(Minute.parseMinute("2019-08-25 03:00"), 25.47);
            typeA.add(Minute.parseMinute("2019-08-25 04:00"), 25.19);
            typeA.add(Minute.parseMinute("2019-08-25 05:00"), 24.65);
            typeA.add(Minute.parseMinute("2019-08-25 06:00"), 24.61);
            typeA.add(Minute.parseMinute("2019-08-25 07:00"), 25.58);
            typeA.add(Minute.parseMinute("2019-08-25 08:00"), 26.43);
            typeA.add(Minute.parseMinute("2019-08-25 09:00"), 26.96);
            typeA.add(Minute.parseMinute("2019-08-25 10:00"), 27.81);
            typeA.add(Minute.parseMinute("2019-08-25 11:00"), 28.69);
            typeA.add(Minute.parseMinute("2019-08-25 12:00"), 29.39);
            typeA.add(Minute.parseMinute("2019-08-25 13:00"), 29.89);
            typeA.add(Minute.parseMinute("2019-08-25 14:00"), 30.32);
            typeA.add(Minute.parseMinute("2019-08-25 15:00"), 30.69);
            typeA.add(Minute.parseMinute("2019-08-25 16:00"), 30.83);
            typeA.add(Minute.parseMinute("2019-08-25 17:00"), 30.85);
            typeA.add(Minute.parseMinute("2019-08-25 18:00"), 30.64);
            typeA.add(Minute.parseMinute("2019-08-25 19:00"), 30.04);
            typeA.add(Minute.parseMinute("2019-08-25 20:00"), 29.51);
            typeA.add(Minute.parseMinute("2019-08-25 21:00"), 28.63);
            typeA.add(Minute.parseMinute("2019-08-25 22:00"), 28.48);
            typeA.add(Minute.parseMinute("2019-08-25 23:00"), 27.15);
            typeA.add(Minute.parseMinute("2019-08-26 00:00"), 27.3);
            typeA.add(Minute.parseMinute("2019-08-26 01:00"), 27.05);
            typeA.add(Minute.parseMinute("2019-08-26 02:00"), 26.84);
            typeA.add(Minute.parseMinute("2019-08-26 03:00"), 26.47);
            typeA.add(Minute.parseMinute("2019-08-26 04:00"), 26.34);
            typeA.add(Minute.parseMinute("2019-08-26 05:00"), 25.95);
            typeA.add(Minute.parseMinute("2019-08-26 06:00"), 26.46);
            typeA.add(Minute.parseMinute("2019-08-26 07:00"), 26.75);
            typeA.add(Minute.parseMinute("2019-08-26 08:00"), 26.94);
            typeA.add(Minute.parseMinute("2019-08-26 09:00"), 27.05);
            typeA.add(Minute.parseMinute("2019-08-26 10:00"), 27.35);
            typeA.add(Minute.parseMinute("2019-08-26 11:00"), 27.67);
            typeA.add(Minute.parseMinute("2019-08-26 12:00"), 28.12);
            typeA.add(Minute.parseMinute("2019-08-26 13:00"), 28.41);
            typeA.add(Minute.parseMinute("2019-08-26 14:00"), 28.67);
            typeA.add(Minute.parseMinute("2019-08-26 15:00"), 28.99);
            typeA.add(Minute.parseMinute("2019-08-26 16:00"), 28.99);
            typeA.add(Minute.parseMinute("2019-08-26 17:00"), 29.02);
            typeA.add(Minute.parseMinute("2019-08-26 18:00"), 29.02);
            typeA.add(Minute.parseMinute("2019-08-26 19:00"), 28.43);
            typeA.add(Minute.parseMinute("2019-08-26 20:00"), 27.87);
            typeA.add(Minute.parseMinute("2019-08-26 21:00"), 27.2);
            typeA.add(Minute.parseMinute("2019-08-26 22:00"), 26.88);
            typeA.add(Minute.parseMinute("2019-08-26 23:00"), 26.31);
            typeA.add(Minute.parseMinute("2019-08-27 00:00"), 26.02);
            typeA.add(Minute.parseMinute("2019-08-27 01:00"), 25.51);
            typeA.add(Minute.parseMinute("2019-08-27 02:00"), 25.12);
            typeA.add(Minute.parseMinute("2019-08-27 03:00"), 25.11);
            typeA.add(Minute.parseMinute("2019-08-27 04:00"), 24.97);
            typeA.add(Minute.parseMinute("2019-08-27 05:00"), 24.85);
            typeA.add(Minute.parseMinute("2019-08-27 06:00"), 24.73);
            typeA.add(Minute.parseMinute("2019-08-27 07:00"), 25.04);
            typeA.add(Minute.parseMinute("2019-08-27 08:00"), 25.68);
            typeA.add(Minute.parseMinute("2019-08-27 09:00"), 26.22);
            typeA.add(Minute.parseMinute("2019-08-27 10:00"), 26.69);
            typeA.add(Minute.parseMinute("2019-08-27 11:00"), 27.3);
            typeA.add(Minute.parseMinute("2019-08-27 12:00"), 27.84);
            typeA.add(Minute.parseMinute("2019-08-27 13:00"), 28.26);
            typeA.add(Minute.parseMinute("2019-08-27 14:00"), 28.6);
            typeA.add(Minute.parseMinute("2019-08-27 15:00"), 29.03);
            typeA.add(Minute.parseMinute("2019-08-27 16:00"), 29.38);
            typeA.add(Minute.parseMinute("2019-08-27 17:00"), 29.62);
            typeA.add(Minute.parseMinute("2019-08-27 18:00"), 29.47);
            typeA.add(Minute.parseMinute("2019-08-27 19:00"), 29.01);
            typeA.add(Minute.parseMinute("2019-08-27 20:00"), 28.31);
            typeA.add(Minute.parseMinute("2019-08-27 21:00"), 27.69);
            typeA.add(Minute.parseMinute("2019-08-27 22:00"), 26.93);
            typeA.add(Minute.parseMinute("2019-08-27 23:00"), 26.37);
        }

        typeA.add(Minute.parseMinute("2019-08-28 00:00"), 26.12);
        typeA.add(Minute.parseMinute("2019-08-28 01:00"), 25.77);
        typeA.add(Minute.parseMinute("2019-08-28 02:00"), 25.42);
        typeA.add(Minute.parseMinute("2019-08-28 03:00"), 25.0);
        typeA.add(Minute.parseMinute("2019-08-28 04:00"), 24.57);
        typeA.add(Minute.parseMinute("2019-08-28 05:00"), 24.23);
        typeA.add(Minute.parseMinute("2019-08-28 06:00"), 24.38);
        typeA.add(Minute.parseMinute("2019-08-28 07:00"), 24.99);
        typeA.add(Minute.parseMinute("2019-08-28 08:00"), 25.86);
        typeA.add(Minute.parseMinute("2019-08-28 09:00"), 26.53);
        typeA.add(Minute.parseMinute("2019-08-28 10:00"), 27.32);
        typeA.add(Minute.parseMinute("2019-08-28 11:00"), 27.95);
        typeA.add(Minute.parseMinute("2019-08-28 12:00"), 28.64);
        typeA.add(Minute.parseMinute("2019-08-28 13:00"), 29.38);
        typeA.add(Minute.parseMinute("2019-08-28 14:00"), 29.74);
        typeA.add(Minute.parseMinute("2019-08-28 15:00"), 30.13);
        typeA.add(Minute.parseMinute("2019-08-28 16:00"), 30.42);
        typeA.add(Minute.parseMinute("2019-08-28 17:00"), 30.48);
        typeA.add(Minute.parseMinute("2019-08-28 18:00"), 30.14);
        typeA.add(Minute.parseMinute("2019-08-28 19:00"), 29.41);
        typeA.add(Minute.parseMinute("2019-08-28 20:00"), 28.47);
        typeA.add(Minute.parseMinute("2019-08-28 21:00"), 28.05);



        return collection;
    }

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                TimeChart chart = new TimeChart(
                    "Date axis demo",
                    "Date axis labels are visible");

                chart.pack();
                chart.setVisible(true);
            }
        });
    }
}

请注意,我已将首选图表大小更改为1529×538(我需要生成一个具有此尺寸的PNG),并且我还引入了一个新的静态变量,名为很多值。最初,它被设置为false,这是一个屏幕截图:

enter image description here

但是如果我改变很多值 to true(这会将更多数据添加到集合中 - 您可以在源代码中看到),域轴的最后一个标签将被剪切。这是屏幕截图很多值=true:

enter image description here

UPDATE2

我已经深入研究了 JFreeChart 的源代码,并且正在解决问题。 (我还必须从上面的源代码中删除一些行以适应 30k 字符的限制)

Consider the following screenshot: enter image description here

我认为边距值应用于图表当前数据绘制之前和之后,而不是应用于当前范围刻度。这就是为什么最后一个刻度标签可以被剪掉的原因。

如果数据填满直到最后一个刻度(当前为 2019-08-29 00:00),那不会有问题,因为在这种情况下,边距将允许正确打印该值。

让我们看一下这个概念的验证。我向数据集添加了三行:

typeA.add(Minute.parseMinute("2019-08-28 21:00"), 28.05); //original line
typeA.add(Minute.parseMinute("2019-08-28 22:00"), 28.05); //new line
typeA.add(Minute.parseMinute("2019-08-28 23:00"), 28.05); //new line
typeA.add(Minute.parseMinute("2019-08-29 00:00"), 28.05); //new line

And now the result: enter image description here

这也可以通过修改轴的值来实现最大日期通过致电:

timeAxis.setMaximumDate(new Date(119,7,29,4,36));

现在我要向前去寻找这个地方最大日期计算出来的。如果有人知道,请告诉我。


该效果是由于人为减小图表的首选大小同时显式增加日期轴刻度标签大小而引起的。请注意,省略对setPreferredSize()消除效果。或者,您可以按照建议设置轴边距进行补偿here。下面的示例将默认上限和下限加倍,从刻度间隔的 10% 到 20%。

timeAxis.setUpperMargin(DateAxis.DEFAULT_UPPER_MARGIN * 2);
timeAxis.setLowerMargin(DateAxis.DEFAULT_LOWER_MARGIN * 2);

更准确地说:它是这些标签长度的最终解决方案还是只是针对当前情况的特定黑客?

DateAxis使用标签的计算大小将标签置于其刻度/网格线上。由于字体大小因平台而异,并且标签大小因格式和区域设置而异,因此始终存在某种值组合可能会针对给定的封闭组件大小裁剪标签。当调整组件大小时,显示的标签数量将发生变化以优化显示。只要允许图表随着大小的变化而调整,讨论here,用户不会有任何麻烦。调整示例框架的大小或使用这些内置的controls看看效果。

我不想硬连接数据集;即使我只有 1 条记录,或者有 100 条记录,图表也必须在所有记录计数下看起来都不错。

为此,引导用户互动功能适合您的用例:这个example使用组合框侦听器进行切换setVerticalTickLabels();您可以保留用户的首选项,如图所示here. This example提供缩放控件的工具栏。引用的例子here将平移与setMouseWheelEnabled().

另一方面,不要忽视提到的其他问题here,因为它们是常见的陷阱,可能会使其他问题难以隔离。

margins doubled

import java.awt.Color;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.text.SimpleDateFormat;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
import org.jfree.chart.ui.ApplicationFrame;
import org.jfree.chart.ui.UIUtils;
import org.jfree.data.time.Day;
import org.jfree.data.time.Hour;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;

/**
 * @see https://stackoverflow.com/a/57637615/230513
 * @see https://stackoverflow.com/a/57544811/230513
 */
public class TimeChart extends ApplicationFrame {

    public TimeChart(String applicationTitle, String chartTitle) {
        super(applicationTitle);

        DateAxis timeAxis = new DateAxis("Timestamp");
        timeAxis.setUpperMargin(DateAxis.DEFAULT_UPPER_MARGIN * 2);
        timeAxis.setLowerMargin(DateAxis.DEFAULT_LOWER_MARGIN * 2);
        timeAxis.setDateFormatOverride(new SimpleDateFormat("YYYY-MM-dd HH:mm"));
        NumberAxis numberAxis = new NumberAxis("Number");
        XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);
        XYPlot plot = new XYPlot(createDataset(), timeAxis, numberAxis, renderer);
        plot.setBackgroundPaint(Color.lightGray);
        plot.setDomainGridlinePaint(Color.white);
        plot.setRangeGridlinePaint(Color.white);
        JFreeChart lineChart = new JFreeChart(chartTitle, plot);
        lineChart.setBackgroundPaint(Color.white);
        ChartPanel chartPanel = new ChartPanel(lineChart) {
            @Override
            public Dimension getPreferredSize() {
                return new Dimension(560 , 367);
            }
        };
        add(chartPanel);
    }

    private TimeSeriesCollection createDataset() {
        TimeSeries typeA = new TimeSeries("TypeA");
        TimeSeries typeB = new TimeSeries("TypeB");
        TimeSeriesCollection collection = new TimeSeriesCollection();

        collection.addSeries(typeA);
        collection.addSeries(typeB);
        typeA = collection.getSeries("TypeA");

        typeA.add(new Hour(8, new Day()), 1.0);
        typeA.add(new Hour(10, new Day()), 1.0);
        typeA.add(new Hour(11, new Day()), 1.0);
        typeA.add(new Hour(13, new Day()), 1.0);
        typeA.add(new Hour(16, new Day()), 2.0);
        typeA.add(new Hour(18, new Day()), 2.0);

        typeB.add(new Hour(8, new Day()), 1.0);
        typeB.add(new Hour(19, new Day()), 2.0);
        typeB.add(new Hour(20, new Day()), 5.0);

        return collection;
    }

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                TimeChart chart = new TimeChart(
                    "Date axis demo",
                    "Date axis labels are visible");
                chart.pack();
                UIUtils.centerFrameOnScreen(chart);
                chart.setVisible(true);
            }
        });
    }
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

JFreeChart X 轴标签超出图表区域 的相关文章

随机推荐

  • vue.js中的onclick多个元素

    我正在创建一个功能来隐藏和显示图像缩略图的描述 如果用户单击图像缩略图 描述将显示为动画 我已经遵循了 VueJS 中关于转换的教程 但不幸的是只有一个缩略图有效 其余的无效 我已经在我的过程中删除了脚本try and errors 那么
  • MySQL MIN/MAX 返回正确的值,但不返回相关的记录信息

    我真的很困惑 我显然不理解最小 最大概念 我正在尝试从 work type 和 work id 分组中获取最新行 如果我从 MIN 更改为 MAX 它会更改返回的时间戳 但它永远不会带来该记录中的状态信息 Example SELECT CO
  • iTask - 将参数值传递给匿名过程

    我需要创建一定数量的 iTask 来执行动态数组和记录中其他字段的操作 每个 iTask 都在该数组的特定部分中运行 该数组是记录中的一个字段 它作为 var 参数传递给 iTask 数组字段中的操作进展顺利 但其他记录字段在所有任务完成工
  • 在代码中保存具有特定名称的 jupyter 笔记本

    我有一个 Jupyter 笔记本 它或多或少是一个完成事情的 模板 例如 笔记本是每个国家经济数据的模板 所有的绘图和分析都是标准化的 我正在寻找一种以编码方式完成保存的方法 而不是自己手动命名 无论如何 如果我有一个变量标记为 my as
  • 当鼠标悬停在其中一个元素上时,突出显示具有相同类的所有元素

    在 JavaScript 中 当鼠标悬停在其中一个项目上时 是否可以突出显示具有相同类的所有项目 例如 如果我在课堂上有两个段落p1和全班的 2 段p2 我想要两个元素p1在鼠标悬停时突出显示 并且我还希望 p2 的两个元素在鼠标悬停时突出
  • 如何获取 Instagram 个人资料图片

    在我的应用程序中 想要将 Instagram 个人资料图片放入他的帐户中 如何以编程方式从 Instagram 获取用户的个人资料图片 例如 使用 Instagram API 用户端点 https api instagram com v1
  • 找不到类型或命名空间名称[重复]

    这个问题在这里已经有答案了 我有一个C 包含多个项目的解决方案Visual Studio 2010 一个是测试项目 我称之为 PrjTest 另一个是Windows Forms Application项目 我称之为 PrjForm 还有Pr
  • 如何设置sbt的堆大小?

    我正在使用 SBT 0 12 0 我已经阅读了有关堆栈溢出的其他答案并遵循了它们 但是它们都没有帮助 例如 create ForkRun类 我在使用 sbt 期间没有观察到任何分叉进程 设置环境变量JAVA OPTS 它已设置 但 sbt
  • 匹配所有语言php字母的正则表达式

    我花了几个小时试图在 php 中找到正确的正则表达式来匹配任何语言字母 但防止它留出空间 我试过这个 p L 这没关系 但看起来它允许空间 然后我尝试了这个 w 看起来仍然有空间 有人可以帮忙吗 您需要指定 Unicode 修饰符u to
  • 在 Swift 中使用 AlamoFire 创建通用方法

    我使用 AlamoFire 进行 API 调用 并且在我的项目中都有这样的内容 static func login userName String password String gt User let parameters userNam
  • 如何在android中的警报对话框中添加阴影效果

    我想在警报对话框中添加阴影效果 我想要在我的对话框中出现这种类型的阴影效果在这里我发布了3个文件 第一个是style xml 第二个是theme java 第三个文件是demo bg xml文件 我已经尝试过这样的操作 Style xml
  • 从外部触发淘汰赛事件

    我有以下 html 表单中的 Select Element
  • 获取当前键盘光标位置

    无论如何 是否可以像获取鼠标光标位置一样全局获取键盘光标 插入符号 当前位置的坐标mouseLocation 不 没有办法在全球范围内做到这一点 如果您想在自己的应用程序中执行此操作 例如在 NSTextView 中 您可以这样做 NSRa
  • 为什么在 WPF 自定义 2D 绘图中使用具有破折号图案的笔会导致巨大(!)性能下降?

    希望有人能阐明这一点 以便我可以使用带有破折号图案的笔 我正在写一个可滚动的图表 Panel inside ScrollViewer实现IScrollInfo 在 WPF 中使用DrawingVisual s DataContext Dra
  • 使用 vs 2010 在负载测试中测试迭代设置

    我想测试 250 个并发用户的应用程序 我对负载测试设置有一些疑问 实现上述目标的正确设置应该是什么 我已将最大用户数设置为 250 并将运行设置中的测试迭代设置为 1 那么它会发送 250 个虚拟请求吗 or 我必须将最大用户数设置为 2
  • string类与其他类有何区别?

    我们可以做的 String string ourstring 但我们不能为用户定义的类创建这样的对象 UserClass uc Java 如何允许我们直接设置值java lang String只上课 java lang String是一个特
  • 如何在 IgGrid 单元格(Infragistics)中获取正则表达式?

    如何在 igGrid 更新中的 igTextEditor 上使用正则表达式 我尝试使用验证选项 但没有成功 schedulerTable igGrid columns scope schedulerColumns width 87 heig
  • 如何使用 React 删除待办事项列表中的项目

    我正在使用 React 创建一个待办事项列表应用程序 在我的应用程序中 当我单击 x 按钮删除项目并使用 console log 检查当前数组时 我可以看到该数组已正确更新为我要删除的项目从数组列表中 但 Dom 只渲染我想要删除的项目而不
  • 提高自定义无限滚动的速度

    我有一个自定义的无限滚动 运行完美 但速度非常慢 这是处理 ajax 请求的脚本 function ga infinite scroll trigger this on infinite scroll add filter woocomme
  • JFreeChart X 轴标签超出图表区域

    我有一个JFreeChart图表与DateAxis作为域 它看起来非常漂亮 但是最后一个轴标签有时会超出图表区域 这是要重现的示例代码 public class LineChart AWT extends ApplicationFrame