如何使用Scatter Plot highchart绘制下图?(How to draw following graph using Scatter Plot highchart?)
如何使用Scatter Plot highchart绘制下图? 我试图实现这种使用Highcharts在屏幕截图中显示的情节。 到现在为止,我可以使用Scatter Plot将点绘制到图表上,但是我无法从X轴和Y轴绘制这两条红线。 你们中的任何人都可以帮助我,我需要做的是从一个点绘制两条直线,一条朝向X轴,另一条朝向Y轴。 附加的代码只是我用于绘制散点图的JS代码。 谢谢
/* calculationChart */ $(function () { $('#FHIchart').highcharts({ chart: { type: 'scatter', zoomType: 'xy' }, title: { text: 'Height Versus Weight of 507 Individuals by Gender' }, subtitle: { text: 'Source: Heinz 2003' }, xAxis: { title: { enabled: true, text: 'Strategic Alignment' }, startOnTick: true, endOnTick: true, showLastLabel: true, }, yAxis: { title: { text: 'Process & Technology Integration' }, }, legend: { layout: 'vertical', align: 'left', verticalAlign: 'top', x: 100, y: 70, floating: true, backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF', borderWidth: 1 }, plotOptions: { scatter: { lineWidth: 2 } }, series: [{ name: ' ', color: 'Red', data: [[3.1, 3]] }] }); });
这是我的代码。
How can i draw following graph using Scatter Plot highchart? I am trying to achieve this kind of plot that is being displayed in screenshot using Highcharts. Till now I am able to Draw point onto the chart using Scatter Plot but I am having trouble plot these two red line from X-axis and Y-axis. Can anyone of you help me here the what I need to do to draw two straight line from a point, one toward X-axis and second toward Y-axis. The attached code is only the JS code that I used for ploting the scatter graph. Thanks
/* calculationChart */ $(function () { $('#FHIchart').highcharts({ chart: { type: 'scatter', zoomType: 'xy' }, title: { text: 'Height Versus Weight of 507 Individuals by Gender' }, subtitle: { text: 'Source: Heinz 2003' }, xAxis: { title: { enabled: true, text: 'Strategic Alignment' }, startOnTick: true, endOnTick: true, showLastLabel: true, }, yAxis: { title: { text: 'Process & Technology Integration' }, }, legend: { layout: 'vertical', align: 'left', verticalAlign: 'top', x: 100, y: 70, floating: true, backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF', borderWidth: 1 }, plotOptions: { scatter: { lineWidth: 2 } }, series: [{ name: ' ', color: 'Red', data: [[3.1, 3]] }] }); });
here is my code.
原文:https://stackoverflow.com/questions/43641324
最满意答案
您可以使用条件标签 。
例如:
add_filter( 'template_include','include_template_function', 1 ); function include_template_function( $template_path ) { if( is_search() ) $template_path = plugin_dir_path( __FILE__ ) .'/movie-searchresult_reviews.php'; if( is_author() ) $template_path = plugin_dir_path( __FILE__ ) .'/user_profile.php'; return $template_path; }
You can use Conditional Tags for this.
For example:
add_filter( 'template_include','include_template_function', 1 ); function include_template_function( $template_path ) { if( is_search() ) $template_path = plugin_dir_path( __FILE__ ) .'/movie-searchresult_reviews.php'; if( is_author() ) $template_path = plugin_dir_path( __FILE__ ) .'/user_profile.php'; return $template_path; }
相关问答
更多-
使用过滤器时,需要返回一个值而不是回显它。 也许这导致了这个问题。 从有关add_filter()函数的文档: 稍后应用过滤器时,每个绑定回调按优先级顺序运行,并有机会通过返回新值来修改值。 When you use filters, you need to return a value not echo it. Maybe that is causing the issue. From documentation about add_filter() function: When the filter i ...
-
wordpress插件add_filter(login_redirect不起作用(wordpress plugin add_filter(login_redirect does not work)[2022-05-02]
10表示您的函数在过滤login_redirect的其他函数中所采用的优先级 3表示函数接受的参数数量。 请参阅: http : //codex.wordpress.org/Function_Reference/add_filter 10 represents the priority your function takes among the others filtering login_redirect 3 represents the number of arguments your function ... -
如何使用插件add_filter删除或更改wordpress中的
标签?(How remove or change [2022-07-25]tag in wordpress using plugin , add_filter ?) 尝试使用wp_title钩子 add_filter( 'wp_title', 'custom_title', 20 ); function custom_title( $title ) { return str_replace('My old title', 'New title', $title); } Try using the wp_title hook add_filter( 'wp_title', 'custom_title', 20 ); function custom_titl ... -
1) if你错过了大括号。 所以这个条件if ( is_page('Profile'))只适用于它后面的第一行; 2)在任何情况下,回调过滤器函数都必须返回值。 所以你必须写这样的东西: function Welcome($content) { if ( is_page('Profile')) { // your changes for content return $content; } return $content; } 3)为什么你使用单引号查询参 ...
-
你确定在require_once(ABSPATH . 'wp-settings.php');之后复制了它require_once(ABSPATH . 'wp-settings.php'); 在wp-config.php文件中? 例如: define('WP_DEBUG', false); /* That's all, stop editing! Happy blogging. */ /** Absolute path to the WordPress directory. */ if ( !defin ...
-
您可以使用条件标签 。 例如: add_filter( 'template_include','include_template_function', 1 ); function include_template_function( $template_path ) { if( is_search() ) $template_path = plugin_dir_path( __FILE__ ) .'/movie-searchresult_reviews.php'; i ...
-
WordPress - add_filter函数和字符串争论?(WordPress - add_filter function and a string arguement?)[2022-01-18]
必须有变量名称: function custom_gallery_output_dynamic_position($output, $id, $item, $data, $i, $position) { 您可以使用默认值定义它: function custom_gallery_output_dynamic_position($output, $id, $item, $data, $i, $position='bottom-right') { There must be variable name: fu ... -
自己修复它。 在我的主题的functions.php创建了一个单独的(通用)函数,如下所示: add_filter('cmb_meta_boxes', function( array $metaboxes = array() ) { global $fsb_resource_library, $fsb_partner; if( class_exists('fsb_resource_library') && is_object($fsb_resource_library) ) { ...
-
通过在WordPress中使用add_filter()过滤内容来添加视频(Adding a video by filtering content in WordPress with add_filter())[2023-10-29]
您正在完全替换视频内容,而不是将视频附加到内容。 我会这样做,取决于你想要放置视频的位置,在内容的顶部或底部。 真的是$ video。$ content ..或$ content。$ video add_filter('the_content', 'spd_video'); function spd_video ($content){ if(is_front_page()){ $video = '你正在覆盖当前的内容。 您应该将您的内容与当前内容连接起来. function my_plugin($content) { $content. = "Custom Plugin Content"; return $content; } You're overwriting current content. You should concatenate your content to current content with . function my_plugin($content) ...相关文章
更多- JFreeChart 创建三维/3D饼图/条形图
- 请教下图是UML中什么图
- SVG 绘制路径path
- SVG 绘制圆形circle
- SVG 绘制曲线polyline
- JOGL绘制图形
- SVG 绘制多边形polygon
- 绘制坦克_HTML5网页游戏坦克大战06
- 关于android自动适应机型分辨率和旋转绘制图片帧的问题.
- 图形数据库、NOSQL和Neo4j(转载)
最新问答
更多- h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
- 创建一个功能(Create a function)
- 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
- PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
- Qt冻结循环的原因?(Qt freezing cause of the loop?)
- TableView重复youtube-api结果(TableView Repeating youtube-api result)
- 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
- SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
- 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
- 以编程方式创建UITableView(Creating a UITableView Programmatically)
- 如何打破按钮上的生命周期循环(How to break do-while loop on button)
- C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
- 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
- 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
- Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
- 设置kotlin扩展名(Setting a kotlin extension)
- 如何并排放置两个元件?(How to position two elements side by side?)
- 如何在vim中启用python3?(How to enable python3 in vim?)
- 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
- 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
- Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
- dedecms如何安装?
- 在哪儿学计算机最好?
- 学php哪个的书 最好,本人菜鸟
- 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
- 如何覆盖错误堆栈getter(How to override Error stack getter)
- 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
- USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
- 电脑高中毕业学习去哪里培训
- 正则表达式验证SMTP响应(Regex to validate SMTP Responses)