andileco → created an issue.
Thanks for the fix, @nikathone, and thanks for testing, @yospyn!
andileco → made their first commit to this issue’s fork.
Moving to the drilldown module to have it create a field formatter.
This is fixed in https://www.drupal.org/project/charts/issues/3510411 📌 Re-structure Highcharts libraries so that Highcharts "modules" are their own Drupal libraries Active
Thanks, @nikathone!
Looking into this for 2.0.x.
Closing because Web Widgets was never ported beyond Drupal 7.
Looking good from my end. @nikathone, can you review?
Thank you for commenting, @fox mulder! Can you share more details of your set-up so I can figure out how to recreate the error myself?
Using patch #33 on Drupal 11.1.5. Works nicely if I use a custom formatter and (for my use case) set the format to "Y". If I try to use the "Default" formatter and select "HTML Year (2025)", I get the following in the dblog and the values do not show in my rendered view.
Deprecated function: strtr(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\views\Plugin\views\query\MysqlDateSql->getDateFormat() (line 76 of /app/web/core/modules/views/src/Plugin/views/query/MysqlDateSql.php)
#0 /app/web/core/includes/bootstrap.inc(108): _drupal_error_handler_real(8192, 'strtr(): Passin...', '/app/web/core/m...', 76)
#1 [internal function]: _drupal_error_handler(8192, 'strtr(): Passin...', '/app/web/core/m...', 76)
#2 /app/web/core/modules/views/src/Plugin/views/query/MysqlDateSql.php(76): strtr(NULL, Array)
#3 /app/web/core/modules/views/src/Plugin/views/query/Sql.php(1890): Drupal\views\Plugin\views\query\MysqlDateSql->getDateFormat('storage__field_...', NULL)
#4 /app/web/modules/contrib/views_date_format_sql/src/Plugin/views/field/ViewsDateFormatSqlField.php(217): Drupal\views\Plugin\views\query\Sql->getDateFormat('storage__field_...', NULL)
#5 /app/web/core/modules/views/src/ViewExecutable.php(1433): Drupal\views_date_format_sql\Plugin\views\field\ViewsDateFormatSqlField->query(true)
#6 /app/web/core/modules/views/src/ViewExecutable.php(1342): Drupal\views\ViewExecutable->_build('field')
#7 /app/web/core/modules/views/src/ViewExecutable.php(1451): Drupal\views\ViewExecutable->build(NULL)
#8 /app/web/core/modules/views/src/ViewExecutable.php(1514): Drupal\views\ViewExecutable->execute(NULL)
#9 /app/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(2493): Drupal\views\ViewExecutable->render()
#10 /app/web/core/modules/views/src/ViewExecutable.php(1722): Drupal\views\Plugin\views\display\DisplayPluginBase->preview()
#11 /app/web/core/modules/views_ui/src/ViewUI.php(615): Drupal\views\ViewExecutable->preview('attachment_1', Array)
#12 /app/web/core/modules/views_ui/src/ViewPreviewForm.php(63): Drupal\views_ui\ViewUI->renderPreview('attachment_1', Array)
#13 /app/web/core/lib/Drupal/Core/Entity/EntityForm.php(107): Drupal\views_ui\ViewPreviewForm->form(Array, Object(Drupal\Core\Form\FormState))
#14 /app/web/core/modules/views_ui/src/ViewFormBase.php(42): Drupal\Core\Entity\EntityForm->buildForm(Array, Object(Drupal\Core\Form\FormState))
#15 [internal function]: Drupal\views_ui\ViewFormBase->buildForm(Array, Object(Drupal\Core\Form\FormState), 'attachment_1')
#16 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(528): call_user_func_array(Array, Array)
#17 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(370): Drupal\Core\Form\FormBuilder->retrieveForm('view_preview_fo...', Object(Drupal\Core\Form\FormState))
#18 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(625): Drupal\Core\Form\FormBuilder->rebuildForm('view_preview_fo...', Object(Drupal\Core\Form\FormState), Array)
#19 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(321): Drupal\Core\Form\FormBuilder->processForm('view_preview_fo...', Array, Object(Drupal\Core\Form\FormState))
#20 /app/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\views_ui\ViewPreviewForm), Object(Drupal\Core\Form\FormState))
#21 /app/web/core/modules/layout_builder/src/Controller/LayoutBuilderHtmlEntityFormController.php(39): Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#22 [internal function]: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#23 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#24 /app/web/core/lib/Drupal/Core/Render/Renderer.php(593): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#25 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#26 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#27 /app/vendor/symfony/http-kernel/HttpKernel.php(183): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#28 /app/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#29 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /app/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /app/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 /app/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#38 /app/web/core/lib/Drupal/Core/DrupalKernel.php(709): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#39 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#40 {main}
Thank you for testing, @yospyn!
Moving this to 5.1.x.
Nevermind, @nikathone, sparing you the documentation!
This was committed, so marking fixed.
This is looking good. Can I ask you to update the issue summary, @nikathone?
This feature has been in place a long time and is still working. I think there's just a misconfiguration with your view. Please play around with your configurations a bit more or send a video or view export for support. Thank you!
Thank you for getting this started, @tommasorandazzo! The video of the presentation is up: https://youtu.be/irKVKHPSWZ4?si=OrASg2ELCrJ3SLPv&t=2014
andileco → made their first commit to this issue’s fork.
andileco → created an issue.
Works great - thanks!
andileco → created an issue.
Thank you for reporting and suggesting a solution, @ptaff. Would you mind creating an issue fork with the solution you suggested?
andileco → created an issue.
Thanks for this awesome patch, @nikathone!
Closing in favor of: https://www.drupal.org/project/charts/issues/3524784 🐛 Error if stripLabelTags passed NULL in C3/Billboard Active
andileco → created an issue.
Thank you!
andileco → created an issue.
andileco → created an issue.
On second thought, since the main view already has these tags and we're generally sharing that link rather than the embed link, I'm going to close this as "works as designed"; however, I like having this here in case I think of a use case where the embed code might be shared directly, outside of an iframe.
andileco → created an issue.
andileco → created an issue.
andileco → created an issue.
Thank you for your issue. It exists in Drupal 11: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21.... Maybe we can do a check for core version and then run that line if the site is D11. How does your preview look after removing that line? Are all the assets loading?
andileco → created an issue.
Closed in favor of the issue linked in comment 3. Thank you, @bluegeek9!
andileco → created an issue.
andileco → created an issue.
andileco → created an issue.
@jaydev bhatt - I checked the main module but not the submodules (but I did look at the code). The main module worked as expected. I don't see anything problematic in the rest of your code. I think since there is currently no working version in Drupal 10 or 11, it's worth committing what you have.
I have made some adjustments. Are they sufficient?
This was merged into a 2.0.x branch. Not sure why it doesn't show committed on this ticket.
This works for me.
*Maintainers*, I would love to require your module as a dependency for Views Share, which I am currently porting. Can you issue a Drupal 11 version of the module? I think only dev is currently D11 ready.
andileco → made their first commit to this issue’s fork.
Thanks for your review, @routinet!
I want people to go with another, more-active library.
andileco → made their first commit to this issue’s fork.
andileco → made their first commit to this issue’s fork.
andileco → made their first commit to this issue’s fork.
Yes, we can add it. @bluegeek9, do you have time to work on it?
@bluegeek9, I see everything is green. Is there more you wanted to do on this, or is it ready for review?
Very excited to have this one in!
andileco → made their first commit to this issue’s fork.
Added a HowTo page: https://www.drupal.org/docs/8/modules/charts/charts-howtos-0/51x-extend-... →
I'm going to close this, because I agree a custom module is the best solution for this for now. However, here's how you could do this:
MY_MODULE.info.yml
name: 'Highcharts Wordcloud'
type: module
description: 'Enables creation of Wordclouds using the Highcharts library.'
core_version_requirement: ^10.3 || ^11
package: Examples
dependencies:
- 'charts:charts'
- 'charts:charts_highcharts'
MY_MODULE.libraries.yml
MY_MODULE:
version: VERSION
js:
/libraries/highcharts_wordcloud/wordcloud.js: { minified: true }
cdn:
/libraries/highcharts_wordcloud/wordcloud.js: https://code.highcharts.com/12.1.1/modules/wordcloud.js
dependencies:
- charts/global
- charts_highcharts/charts_highcharts
- charts_highcharts/highcharts
MY_MODULE.module
<?php
/**
* Implements hook_chart_alter().
*/
function MY_MODULE_chart_alter(array &$element, $chart_id) {
$element['#attached']['library'][] = 'MY_MODULE/MY_MODULE';
}
/**
* Implements HOOK_charts_plugin_supported_chart_types_alter().
*/
function MY_MODULE_charts_plugin_supported_chart_types_alter(array &$types, string $chart_plugin_id) {
if ($chart_plugin_id === 'highcharts') {
$types[] = 'wordcloud';
}
}
MY_MODULE.charts_types.yml
wordcloud:
label: 'Wordcloud'
axis: 'y_only'
axis_inverted: false
stacking: false
MY_MODULE.routing.yml
MY_MODULE.display:
path: /wordcloud-example
defaults:
_controller: '\Drupal\MY_MODULE\Controller\MyModule::display'
_title: 'A Wordcloud'
requirements:
_permission: 'access content'
src/Controller/MyModule.php
<?php
namespace Drupal\charts_api_example\Controller;
use Drupal\Component\Uuid\UuidInterface;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\Messenger\MessengerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Charts Api Example.
*/
class ChartsApiExample extends ControllerBase {
/**
* Display the dashboard of charts.
*
* @return array
* Array to render.
*/
public function display() {
// This is a container for the word cloud.
$charts_container = [
'#type' => 'container',
'content' => [],
];
$data = 'Chapter 1. Down the Rabbit-Hole ' .
'Alice was beginning to get very tired of sitting by her sister on ' .
'the bank, and of having nothing to do: ' .
'once or twice she had peeped into the book her sister was reading, ' .
'but it had no pictures or conversations ' .
'in it, \'and what is the use of a book,\' thought Alice ' .
'\'without pictures or conversation?\'' .
'So she was considering in her own mind (as well as she could, for ' .
'the hot day made her feel very sleepy ' .
'and stupid), whether the pleasure of making a daisy-chain would be ' .
'worth the trouble of getting up and picking ' .
'the daisies, when suddenly a White Rabbit with pink eyes ran close ' .
'by her.';
// Convert text to lowercase and remove punctuation
$text = strtolower($data);
$text = preg_replace('/[^\p{L}\p{N}\s]/u', '', $text);
// Split text into words
$words = preg_split('/\s+/', $text, -1, PREG_SPLIT_NO_EMPTY);
// Count word frequencies.
$word_counts = array_count_values($words);
// Format the result.
$result = [];
foreach ($word_counts as $word => $count) {
$result[] = [
'name' => $word,
'weight' => $count
];
}
$charts_container['content']['wordcloud'] = [
'#type' => 'chart',
'#library' => 'highcharts',
'#title' => $this->t('Highcharts Word Cloud'),
'#chart_type' => 'wordcloud',
'series' => [
'#type' => 'chart_data',
'#title' => $this->t('Occurances'),
'#data' => $result,
],
];
return $charts_container;
}
}
I want to re-examine the way I'm getting array values from the ChartDataCollectorTable class.
Thank you, @loopy1492! I really appreciate the effort you took to understand the new structure and to upgrade - this really helps me (and others) focus on the current version and make that the best it can be. Thank you also for contributing the code examples!
I think this is actually handled already by the library class attributes.
I did publish the module I mentioned. It probably needs a little maintenance: https://www.drupal.org/project/charts_highstock →
Looks good - thank you!
andileco → made their first commit to this issue’s fork.
Thank you - looks good!
I had to make an adjustment or none of the charts would show.
andileco → made their first commit to this issue’s fork.
Thank you! I plan to review this afternoon.
andileco → changed the visibility of the branch 5.1.x to hidden.
andileco → changed the visibility of the branch 3391197-enable-support-for to hidden.