0值柱形图 - 高图(0 value column chart - highchart)
如何在柱形图中为零值点在x轴下方产生轻微的阴影或颜色? 现在什么都没有显示出来。
设置minPointLength属性会使一条线出现在x轴上方。
任何帮助或指针都会有所帮助。
以下是我的选择:
plotOptions: { column: { shadow: false, pointWidth: 11.5, borderWidth: 0.5, enableMouseTracking: false, minPointLength: 1 } }, yAxis: { labels: { align: 'left', style: { color: 'gray', fontWeight: 'normal', fontSize: '8.5px', fontFamily: 'Arial' } }, minorGridLineWidth: 1, minorTickInterval: 10000, minorGridLineColor: 'white', minorTickWidth: 0, title: { text: '', rotation: 270.0, style: { fontWeight: 'normal' }, margin: 20, style: { fontWeight: 'normal', fontFamily: 'Arial', color: '#666666', fontSize: '11px' } }, opposite: true, min: 0, max: 500000, tickInterval: 100000, gridLineWidth: 0.0 }
这让我比x轴高1px点。 但我正在寻找的是xAxis下方的小阴影/ 1px点。
How do I make a slight shadow or color come up below the x axis for zero valued points in column charts? Right Now nothing is shown.
Setting the minPointLength property makes a line come up above the x Axis.
Any help or pointers would help.
Below are my options:
plotOptions: { column: { shadow: false, pointWidth: 11.5, borderWidth: 0.5, enableMouseTracking: false, minPointLength: 1 } }, yAxis: { labels: { align: 'left', style: { color: 'gray', fontWeight: 'normal', fontSize: '8.5px', fontFamily: 'Arial' } }, minorGridLineWidth: 1, minorTickInterval: 10000, minorGridLineColor: 'white', minorTickWidth: 0, title: { text: '', rotation: 270.0, style: { fontWeight: 'normal' }, margin: 20, style: { fontWeight: 'normal', fontFamily: 'Arial', color: '#666666', fontSize: '11px' } }, opposite: true, min: 0, max: 500000, tickInterval: 100000, gridLineWidth: 0.0 }
This gives me a 1px point above x Axis. But what I am looking for is a small shadow/1px point below the xAxis.
原文:https://stackoverflow.com/questions/16706633
最满意答案
@Sonal:遇到问题,你正在使用2个onPrepare函数,这些函数是冲突的,只使用一个,所以修改后的工作配置将是:
var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter'); var reporter = new HtmlScreenshotReporter({ dest: 'target/screenshots' , filename: 'my-report.html' }); exports.config = { directConnect: true, //seleniumAddress: 'http://localhost:4444/wd/hub', capabilities: { 'browserName': 'chrome' } , framework: 'jasmine' , specs: ['spec.js'] , allScriptsTimeout: 180000 , getPageTimeout: 180000 , jasmineNodeOpts: { defaultTimeoutInterval: 180000 }, // Setup the report before any tests start beforeLaunch: function () { return new Promise(function (resolve) { reporter.beforeLaunch(resolve); }); }, // Close the report after all tests finish afterLaunch: function (exitCode) { return new Promise(function (resolve) { reporter.afterLaunch(resolve.bind(this, exitCode)); }); } , onPrepare: function () { var width = 1300; var height = 1200; browser.driver.manage().window().setSize(width, height); jasmine.getEnv().addReporter(reporter); afterAll(function (done) { process.nextTick(done); }) } };
我在我的系统中进行了测试,它运行良好;)
@Sonal: Got the issue, you are using 2 onPrepare functions which is conflicting, use only one, so the modified working config will be:
var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter'); var reporter = new HtmlScreenshotReporter({ dest: 'target/screenshots' , filename: 'my-report.html' }); exports.config = { directConnect: true, //seleniumAddress: 'http://localhost:4444/wd/hub', capabilities: { 'browserName': 'chrome' } , framework: 'jasmine' , specs: ['spec.js'] , allScriptsTimeout: 180000 , getPageTimeout: 180000 , jasmineNodeOpts: { defaultTimeoutInterval: 180000 }, // Setup the report before any tests start beforeLaunch: function () { return new Promise(function (resolve) { reporter.beforeLaunch(resolve); }); }, // Close the report after all tests finish afterLaunch: function (exitCode) { return new Promise(function (resolve) { reporter.afterLaunch(resolve.bind(this, exitCode)); }); } , onPrepare: function () { var width = 1300; var height = 1200; browser.driver.manage().window().setSize(width, height); jasmine.getEnv().addReporter(reporter); afterAll(function (done) { process.nextTick(done); }) } };
I tested it in my system and it is working perfectly ;)
相关问答
更多-
您似乎错误地使用了超时配置。 allScriptTimeout仅适用于后端应用程序脚本,不适用于整个Jasmine规范 请看下面解释的三个超时 allScriptsTimeout - 此超时配置指示时间 应用程序需要完成后端脚本的运行 getPageTimeout - 表示等待Page的时间 加载 jasmineNodeOpts.defaultTimeoutInterval - 这表示 Jasmine等待整体规格的时间 因此,在您的情况下,您增加jasmineNodeOpts.defaultTimeoutI ...
-
@Sonal:遇到问题,你正在使用2个onPrepare函数,这些函数是冲突的,只使用一个,所以修改后的工作配置将是: var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter'); var reporter = new HtmlScreenshotReporter({ dest: 'target/screenshots' , filename: 'my-report.html' }); expor ...
-
protractor-html-screenshot-reporter与jasmine 2不兼容。最新版本的量角器Jasmine2配有Jasmine2 。你可以使用 - protractor-jasmine2-html-reporter 对于Json报告,您需要在config文件中添加resultJsonOutputFile 。 resultJsonOutputFile: 'Path to your Report.json' conf.js代码片段 var Jasmine2HtmlReporter = ...
-
你需要检查以下事项: 您是将Jenkins作为服务器还是本地运行? 如果在本地运行它是您正在运行的服务或war文件? Jenkins是否有权将文件写入当前目录? 您是否正确设置了环境变量? 您认为当前的问题主要是Jenkins没有权限在您的目录中编写文件(创建报告)。 请检查一下! The actual problem was the fact that Jenkins was running as a service in the background. When ran as a service it ...
-
您有语法错误: 在onPrepare()之前丢失: 替换,用; 在addReporter()调用之后 删除; 在onPrepare() 固定版本: // An example configuration file. var HtmlReporter = require('protractor-html-screenshot-reporter'); var reporter=new HtmlReporter({ baseDirectory: './protractor-result', // a lo ...
-
protractor-html-screenshot-reporter不起作用(protractor-html-screenshot-reporter does not work)[2021-11-19]
Jasmine allure Reporter更适合reports和screenshots 以下是它的代码: //conf.js exports.config = { framework: 'jasmine2', jasmineNodeOpts: { showColors: true, includeStackTrace: true, defaultTimeoutInterval: 144000000 }, directConnect: true, seleniumAddress: ' ... -
它更改为capabilities.get('browserName') 。 It changed to capabilities.get('browserName').
-
我可以将jasmine-spec-reporter的输出写入文件吗?(Can I write the output of jasmine-spec-reporter to file?)[2023-02-10]
终端上的输出看起来很棒! 有没有办法将此输出保存到文件 这个包是你想要的https://www.npmjs.com/package/jasmine-reporters 。 它包含几种不同的报告选项。 如果要将xml解析为html文件,可以使用https://www.npmjs.com/package/jasmine-xml2html-converter The output on the terminal looks great! Is there any way to save this output t ... -
wdBrowser.context('NATIVE_APP').then(() => { browser.takeScreenshot().then(function (png) { console.log('browser.takeScreenshot()'); var stream = fs.createWriteStream('screenshot.png'); stream.write(new Buffer ...
-
您需要在需要时添加protractor-jasmine2-html-reporter的完整路径。 尝试放入完整路径,然后运行测试脚本。 这是一个样本 - var Jasmine2HtmlReporter = require('/usr/local/lib/node_modules/protractor-jasmine2-html-reporter'); //sample for MAC var Jasmine2HtmlReporter = require('c:/node_modules/protract ...